id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
9004636_59 | {
"fields": [
{
"declarator": "mockCommandLine = mock(CommandLine.class)",
"modifier": "",
"original_string": "CommandLine mockCommandLine = mock(CommandLine.class);",
"type": "CommandLine",
"var_name": "mockCommandLine"
}
],
"file": "mrbotkicore/src/test/java/core/CommandLin... | {
"body": "@Test\n public void testParseCommandLineArgumentsWithNoExceptionsWithMissingArgument()\n {\n String[] args = {\"-bn\",\"3\",\"-tn\",\"Northern Stars\",\"-t\",\"blau\",\"-ids\",\"13\",\"-s\",\"localhost:3310\",\"-aiarc\",\"../mrbotkiexample/bin/exampleai/brain\",\"-aicl\",\"exampleai.brain.Stri... | {
"fields": [
{
"declarator": "help",
"modifier": "@Option(names={\"-h\", \"-help\", \"--help\"}, description=\"Diese Hilfe\", usageHelp=true)\n private",
"original_string": "@Option(names={\"-h\", \"-help\", \"--help\"}, description=\"Diese Hilfe\", usageHelp=true)\n private boolean help;... | {
"body": "static boolean parseCommandLineArguments( String[] aArguments ) {\n\n Core.getLogger().trace( \"Parsing commandline.\" );\n\n CommandLineOptions commandLineOptions = new CommandLineOptions();\n\n\n try\n {\n CommandLine commandLine = new CommandLine(commandLineOptions... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_18 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestWrongID() \n\t{\n\t\tfellowPlayerCompare = new FellowPlayer(6, \"Bob\", true, 130.7, 70.3, 0);\n\t\tassert(!fellowPlayerOriginal.equals(fellowPlayerCompare));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestWrongID()",
"constructor": false,
"full_signature... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_19 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestWrongName() \n\t{\n\t\tfellowPlayerCompare = new FellowPlayer(5, \"Bill\", true, 130.7, 70.3, 0);\n\t\tassert(!fellowPlayerOriginal.equals(fellowPlayerCompare));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestWrongName()",
"constructor": false,
"full_sign... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_58 | {
"fields": [
{
"declarator": "mockCommandLine = mock(CommandLine.class)",
"modifier": "",
"original_string": "CommandLine mockCommandLine = mock(CommandLine.class);",
"type": "CommandLine",
"var_name": "mockCommandLine"
}
],
"file": "mrbotkicore/src/test/java/core/CommandLin... | {
"body": "@Test\n public void testParseCommandLineArgumentsWithNoExceptionsWithoutRemoteStart()\n {\n String[] args = {\"-bn\",\"3\",\"-tn\",\"Northern Stars\",\"-t\",\"blau\",\"-ids\",\"13\",\"-s\",\"localhost:3310\",\"-aiarc\",\"../mrbotkiexample/bin/exampleai/brain\",\"-aicl\",\"exampleai.brain.Strik... | {
"fields": [
{
"declarator": "help",
"modifier": "@Option(names={\"-h\", \"-help\", \"--help\"}, description=\"Diese Hilfe\", usageHelp=true)\n private",
"original_string": "@Option(names={\"-h\", \"-help\", \"--help\"}, description=\"Diese Hilfe\", usageHelp=true)\n private boolean help;... | {
"body": "static boolean parseCommandLineArguments( String[] aArguments ) {\n\n Core.getLogger().trace( \"Parsing commandline.\" );\n\n CommandLineOptions commandLineOptions = new CommandLineOptions();\n\n\n try\n {\n CommandLine commandLine = new CommandLine(commandLineOptions... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_74 | {
"fields": [
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_string": "Logger mLoggerMock = mock(Logger.class);",
"type": "Logger",
"var_name": "mLoggerMock"
},
{
"declarator": "mReloadAiManagementMock = mock(ReloadAiManagement.class)",
... | {
"body": "@Test\n\tpublic void testGetLogger() {\n\t\tLogger vLoggerToTest = Core.getLogger();\n\t\t\n\t\tassertThat(vLoggerToTest).isInstanceOf(Logger.class);\n\t\tassertThat(vLoggerToTest).isEqualTo(Core.getLogger());\n\t}",
"class_method_signature": "CoreTest.testGetLogger()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static Core sINSTANCE;",
"type": "Core",
"var_name": "sINSTANCE"
},
{
"declarator": "sBOTCORELOGGER = LogManager.getLogger(\"CORE\")",
"modifier": "private static"... | {
"body": "public static synchronized Logger getLogger(){\n \n return sBOTCORELOGGER;\n \n }",
"class_method_signature": "Core.getLogger()",
"constructor": false,
"full_signature": "public static synchronized Logger getLogger()",
"identifier": "getLogger",
"invocations": [],
"modif... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_23 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestWrongOrientation() \n\t{\n\t\tfellowPlayerCompare = new FellowPlayer(5, \"Bob\", true, 130.7, 70.3, 0.2);\n\t\tassert(!fellowPlayerOriginal.equals(fellowPlayerCompare));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestWrongOrientation()",
"constructor": fals... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_35 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testSetWithPolarcoordinatesWithToSmallAngle()\n {\n ReferencePoint referencePoint = new ReferencePoint();\n referencePoint.set(13,-190,true);\n }",
"class_method_signature": "ReferencePointTest.testSetWithPolarcoordinat... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public ReferencePoint set ( ReferencePoint aReferencePoint ) {\n\n mDistanceToPoint = aReferencePoint.getDistanceToPoint();\n mAngleToPoint = aReferencePoint.getAngleToPoint();\n \n mX = aReferencePoint.getXOfPoint();\n mY = aReferencePoint.getYOfPoint();\n \n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_62 | {
"fields": [
{
"declarator": "teamConverter = new TeamConverter()",
"modifier": "",
"original_string": "TeamConverter teamConverter = new TeamConverter();",
"type": "TeamConverter",
"var_name": "teamConverter"
}
],
"file": "mrbotkicore/src/test/java/core/TeamConverterTest.ja... | {
"body": "@Test\n public void testConvertWithValueIsYellow() throws Exception\n {\n TeamConverter teamConverter = new TeamConverter();\n BotInformation.Teams result = teamConverter.convert(\"yellow\");\n assertThat(result).isEqualTo(BotInformation.Teams.Yellow);\n }",
"class_method_si... | {
"fields": [],
"file": "mrbotkicore/src/main/java/core/TeamConverter.java",
"identifier": "TeamConverter",
"interfaces": "implements CommandLine.ITypeConverter<BotInformation.Teams>",
"methods": [
{
"class_method_signature": "TeamConverter.convert(String value)",
"constructor": false,
"... | {
"body": "@Override\n public BotInformation.Teams convert(String value) throws Exception\n {\n if (value == \"gelb\" || value == \"yellow\" || value == \"g\" || value == \"y\")\n return Yellow;\n else if (value == \"blau\" || value == \"blue\" || value == \"b\")\n return Blu... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_15 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestEqual() \n\t{\n\t\tfellowPlayerCompare = new FellowPlayer(5, \"Bob\", true, 130.7, 70.3, 0);\n\t\tassert(fellowPlayerOriginal.equals(fellowPlayerCompare));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestEqual()",
"constructor": false,
"full_signature": "@... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_104 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testSendNullMessagesWithAI() throws Exception {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( mNetworkCommunicationMock );\n\t\twhen(mCoreMock.getAI()).thenReturn( mArtificialIntelligenceMock );\n\t\twhen(mArtificialIntelligenceMock.getAction()).thenAnswer(new Answer<Action>()... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ToServerManagement sINSTANCE;",
"type": "ToServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesToServer = false",
"modifier": "@Gu... | {
"body": "public void startManagement(){\n\t\t\n\t\tif( Core.getInstance().getServerConnection() == null ) {\n\t\t\t\n\t\t\tthrow new NullPointerException( \"NetworkCommunication cannot be NULL when starting ToServerManagement.\" ) ;\n\t\t\t\n\t\t} else if ( isAlive() ){\n\t\t\t\n\t\t\tthrow new IllegalThreadStateEx... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_42 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEpsilonEqualsReferencePointNotExactNotCorrect()\n {\n ReferencePoint referencePoint = new ReferencePoint(50,20, false);\n Boolean result = referencePoint.epsilonEquals(new ReferencePoint(100,38,false), 2);\n assertThat(result).isEqualTo(false);\n }",
... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public boolean epsilonEquals ( ReferencePoint aReferencePoint, double aEpsilon )\n {\n\n return aReferencePoint != null\n && (Math.abs(aReferencePoint.getXOfPoint() - mX) <= aEpsilon)\n && (Math.abs(aReferencePoint.getYOfPoint() - mY) <= aEpsilon);\n\n }",
"clas... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_54 | {
"fields": [
{
"declarator": "botInformationMock = mock(BotInformation.class)",
"modifier": "",
"original_string": "BotInformation botInformationMock = mock(BotInformation.class);",
"type": "BotInformation",
"var_name": "botInformationMock"
},
{
"declarator": "mOwnId =... | {
"body": "@Test\n\tpublic void testInitialConnectionData() {\n\t\tfail(\"Not yet implemented\");\n\t}",
"class_method_signature": "InitialConnectionDataTest.testInitialConnectionData()",
"constructor": false,
"full_signature": "@Test public void testInitialConnectionData()",
"identifier": "testInitialConnect... | {
"fields": [
{
"declarator": "mConnection = new connect()",
"modifier": "private",
"original_string": "private connect mConnection = new connect();",
"type": "connect",
"var_name": "mConnection"
}
],
"file": "mrbotkinetwork/src/main/java/fwns_network/server_2008/InitialConne... | {
"body": "public InitialConnectionData( BotInformation aBot ){\n\t\t\n\t\tmConnection.type = \"Client\";\n\t\tmConnection.protocol_version = 1.0;\n mConnection.nickname = aBot.getBotname();\n\t\tmConnection.rc_id = aBot.getRcId();\n\t\tmConnection.vt_id = aBot.getVtId();\n\t\t\n\t}",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_97 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartManagementWithNetworkConnectionAndAlive() {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( mNetworkCommunicationMock );\n\t\twhen(mCoreMock.getAI()).thenReturn( null );\n\t\t\n\t\tmSUT.startManagement();\n\t\t\n\t\ttry{\n\t\t\tmSUT.startManagement();\n\t\t\tfail(\"Expe... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ToServerManagement sINSTANCE;",
"type": "ToServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesToServer = false",
"modifier": "@Gu... | {
"body": "public void startManagement(){\n\t\t\n\t\tif( Core.getInstance().getServerConnection() == null ) {\n\t\t\t\n\t\t\tthrow new NullPointerException( \"NetworkCommunication cannot be NULL when starting ToServerManagement.\" ) ;\n\t\t\t\n\t\t} else if ( isAlive() ){\n\t\t\t\n\t\t\tthrow new IllegalThreadStateEx... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_78 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartWithoutNetworkConnection() {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( null );\n\t\t\n\t\ttry{\n\t\t\tmSUT.start();\n\t\t\tfail(\"Expected Nullpointerexception\");\n\t\t} catch( Exception vExpectedException ) {\n\t\t\tassertThat(vExpectedException).isInstanceOf(Nu... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static FromServerManagement sINSTANCE;",
"type": "FromServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesFromServer = false",
"modifier"... | {
"body": "@Override\n\tpublic void start(){\n\t\t\n\t\tstartManagement();\n\t\t\n\t}",
"class_method_signature": "FromServerManagement.start()",
"constructor": false,
"full_signature": "@Override public void start()",
"identifier": "start",
"invocations": [
"startManagement"
],
"modifiers": "@Overr... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_39 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEpsilonEqualsReferencePointExactCorrect()\n {\n ReferencePoint referencePoint = new ReferencePoint(50,20,false);\n Boolean result = referencePoint.epsilonEquals(new ReferencePoint(50,20,false),0);\n assertThat(result).isEqualTo(true);\n }",
"class_met... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public boolean epsilonEquals ( ReferencePoint aReferencePoint, double aEpsilon )\n {\n\n return aReferencePoint != null\n && (Math.abs(aReferencePoint.getXOfPoint() - mX) <= aEpsilon)\n && (Math.abs(aReferencePoint.getYOfPoint() - mY) <= aEpsilon);\n\n }",
"clas... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_6 | {
"fields": [
{
"declarator": "mockMovement",
"modifier": "",
"original_string": "Movement mockMovement;",
"type": "Movement",
"var_name": "mockMovement"
}
],
"file": "mrbotkiessentials/src/test/java/essentials/communication/action_server2008/MovementTest.java",
"identifier... | {
"body": "@Test\n public void testEqualsWithSameObject()\n {\n Movement movement = new Movement(51,50);\n assertThat(movement.equals(movement)).isEqualTo(true);\n }",
"class_method_signature": "MovementTest.testEqualsWithSameObject()",
"constructor": false,
"full_signature": "@Test publi... | {
"fields": [
{
"declarator": "NO_MOVEMENT = new Movement( 0, 0)",
"modifier": "public static final",
"original_string": "public static final Movement NO_MOVEMENT = new Movement( 0, 0);",
"type": "Movement",
"var_name": "NO_MOVEMENT"
},
{
"declarator": "mRightWheelVeloc... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tMovement other = (Movement) obj;\n\t\tif (mLeftWheelVelocity != other.mLeftWheelVelocity)\n\t\t\treturn fals... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_81 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStopManagementWhenNotAlive() {\n\t\t\n\t\tassertThat(mSUT.isAlive()).isFalse();\n\t\tmSUT.stopManagement();\n\t\tassertThat(mSUT.isAlive()).isFalse();\n\t\tverify(mLoggerMock, never()).info(\"FromServerManagement stopped.\");\n\t\t\n\t}",
"class_method_signature": "FromServerMana... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static FromServerManagement sINSTANCE;",
"type": "FromServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesFromServer = false",
"modifier"... | {
"body": "public void stopManagement(){\n\t synchronized (this) {\n \n\t mManageMessagesFromServer = false;\n\t\t\n\t }\n\t if( isAlive()){\n\t \n\t \tmSuspended = false;\n\t \t\n\t while(isAlive()){ \n \t\t try {\n Thread.sleep( 10 );\n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_16 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestSameInstance() \n\t{\n\t\tassert(fellowPlayerOriginal.equals(fellowPlayerOriginal));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestSameInstance()",
"constructor": false,
"full_signature": "@Test public void equalsTestSameInstance()",
"identifier": "equa... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_41 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEpsilonEqualsReferencePointExactNotCorrect()\n {\n ReferencePoint referencePoint = new ReferencePoint(50,20,false);\n Boolean result = referencePoint.epsilonEquals(new ReferencePoint(100, 38, false), 0);\n assertThat(result).isEqualTo(false);\n }",
"c... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public boolean epsilonEquals ( ReferencePoint aReferencePoint, double aEpsilon )\n {\n\n return aReferencePoint != null\n && (Math.abs(aReferencePoint.getXOfPoint() - mX) <= aEpsilon)\n && (Math.abs(aReferencePoint.getYOfPoint() - mY) <= aEpsilon);\n\n }",
"clas... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_57 | {
"fields": [
{
"declarator": "mockCommandLine = mock(CommandLine.class)",
"modifier": "",
"original_string": "CommandLine mockCommandLine = mock(CommandLine.class);",
"type": "CommandLine",
"var_name": "mockCommandLine"
}
],
"file": "mrbotkicore/src/test/java/core/CommandLin... | {
"body": "@Test\n public void testParseCommandLineArgumentsWithNoExceptionsWithRemoteStart()\n {\n String[] args = {\"-bn\",\"3\",\"-tn\",\"Northern Stars\",\"-t\",\"blau\",\"-ids\",\"13\",\"-s\",\"localhost:3310\",\"-aiarc\",\"../mrbotkiexample/bin/exampleai/brain\",\"-aicl\",\"exampleai.brain.Striker\... | {
"fields": [
{
"declarator": "help",
"modifier": "@Option(names={\"-h\", \"-help\", \"--help\"}, description=\"Diese Hilfe\", usageHelp=true)\n private",
"original_string": "@Option(names={\"-h\", \"-help\", \"--help\"}, description=\"Diese Hilfe\", usageHelp=true)\n private boolean help;... | {
"body": "static boolean parseCommandLineArguments( String[] aArguments ) {\n\n Core.getLogger().trace( \"Parsing commandline.\" );\n\n CommandLineOptions commandLineOptions = new CommandLineOptions();\n\n\n try\n {\n CommandLine commandLine = new CommandLine(commandLineOptions... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_94 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testRunWithAIAndNeedToRestart() throws Exception {\n\t\twhen(mCoreMock.getAI()).thenReturn( mArtificialIntelligenceMock );\n\t\twhen(mArtificialIntelligenceMock.wantRestart()).thenReturn(true).thenReturn(false);\n\t\t\n\t\tmSUT.startManagement();\n\t\tassertThat(mSUT.isAlive()).isTrue(... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ReloadAiManagement sINSTANCE;",
"type": "ReloadAiManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mAiActive = false",
"modifier": "private",
"... | {
"body": "public void startManagement(){\n\t \n\t if( !isAlive() ){\n\t \n\t mAiActive = true;\n\t super.start();\n\t Core.getLogger().info( \"RestartAiServerManagement started.\" );\n\t \n\t }\n \n\t}",
"class_method_signature": "ReloadAiManagement.startManagement()",
... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_5 | {
"fields": [
{
"declarator": "mockMovement",
"modifier": "",
"original_string": "Movement mockMovement;",
"type": "Movement",
"var_name": "mockMovement"
}
],
"file": "mrbotkiessentials/src/test/java/essentials/communication/action_server2008/MovementTest.java",
"identifier... | {
"body": "@Test\n public void testHashCode()\n {\n Movement movement = new Movement(51,50);\n assertThat(movement.hashCode()).isEqualTo(2562);\n }",
"class_method_signature": "MovementTest.testHashCode()",
"constructor": false,
"full_signature": "@Test public void testHashCode()",
"ide... | {
"fields": [
{
"declarator": "NO_MOVEMENT = new Movement( 0, 0)",
"modifier": "public static final",
"original_string": "public static final Movement NO_MOVEMENT = new Movement( 0, 0);",
"type": "Movement",
"var_name": "NO_MOVEMENT"
},
{
"declarator": "mRightWheelVeloc... | {
"body": "@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + mLeftWheelVelocity;\n\t\tresult = prime * result + mRightWheelVelocity;\n\t\treturn result;\n\t}",
"class_method_signature": "Movement.hashCode()",
"constructor": false,
"full_signature... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_82 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testIsReceivingMessagesWhenNotAlive() {\n\t\tassertThat(mSUT.isAlive()).isFalse();\n\t\t\n\t\tassertThat(mSUT.isReceivingMessages()).isFalse();\n\t}",
"class_method_signature": "FromServerManagementTest.testIsReceivingMessagesWhenNotAlive()",
"constructor": false,
"full_signature... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static FromServerManagement sINSTANCE;",
"type": "FromServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesFromServer = false",
"modifier"... | {
"body": "public boolean isReceivingMessages(){\n \n return isAlive() && (System.currentTimeMillis() - mLastReceivedMessage.get()) < 100;\n \n }",
"class_method_signature": "FromServerManagement.isReceivingMessages()",
"constructor": false,
"full_signature": "public boolean isReceivingM... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_77 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartManagementWithNetworkConnectionAndAlive() {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( mNetworkCommunicationMock );\n\t\twhen(mCoreMock.getAI()).thenReturn( null );\n\t\t\n\t\tmSUT.startManagement();\n\t\t\n\t\ttry{\n\t\t\tmSUT.startManagement();\n\t\t\tfail(\"Expe... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static FromServerManagement sINSTANCE;",
"type": "FromServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesFromServer = false",
"modifier"... | {
"body": "public void startManagement(){\n\n\t\tif( Core.getInstance().getServerConnection() == null ) {\n\n\t\t\tthrow new NullPointerException( \"NetworkCommunication cannot be NULL when starting FromServerManagement.\" ) ;\n\n\t\t} else if ( isAlive() ){\n\t\t\t\n\t\t\tthrow new IllegalThreadStateException( \"Fro... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_98 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartWithoutNetworkConnection() {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( null );\n\t\t\n\t\ttry{\n\t\t\tmSUT.start();\n\t\t\tfail(\"Expected Nullpointerexception\");\n\t\t} catch( Exception vExpectedException ) {\n\t\t\tassertThat(vExpectedException).isInstanceOf(Nu... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ToServerManagement sINSTANCE;",
"type": "ToServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesToServer = false",
"modifier": "@Gu... | {
"body": "@Override\n\tpublic void start(){\n\t\t\n\t\tthis.startManagement();\n\t\t\n\t}",
"class_method_signature": "ToServerManagement.start()",
"constructor": false,
"full_signature": "@Override public void start()",
"identifier": "start",
"invocations": [
"startManagement"
],
"modifiers": "@Ov... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_20 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestWrongStatus() \n\t{\n\t\tfellowPlayerCompare = new FellowPlayer(5, \"Bob\", false, 130.7, 70.3, 0);\n\t\tassert(!fellowPlayerOriginal.equals(fellowPlayerCompare));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestWrongStatus()",
"constructor": false,
"full_... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_36 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testSetWithPolarcoordinatesWithToBigAngle()\n {\n ReferencePoint referencePoint = new ReferencePoint();\n referencePoint.set(13,190,true);\n }",
"class_method_signature": "ReferencePointTest.testSetWithPolarcoordinatesW... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public ReferencePoint set ( ReferencePoint aReferencePoint ) {\n\n mDistanceToPoint = aReferencePoint.getDistanceToPoint();\n mAngleToPoint = aReferencePoint.getAngleToPoint();\n \n mX = aReferencePoint.getXOfPoint();\n mY = aReferencePoint.getYOfPoint();\n \n ... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_9 | {
"fields": [
{
"declarator": "mockMovement",
"modifier": "",
"original_string": "Movement mockMovement;",
"type": "Movement",
"var_name": "mockMovement"
}
],
"file": "mrbotkiessentials/src/test/java/essentials/communication/action_server2008/MovementTest.java",
"identifier... | {
"body": "@Test\n public void testEqualsWithDifferentLeftWheelVelocity()\n {\n\n //TODO Mock? getClass Problem\n\n Movement movement1 = new Movement(51,50);\n Movement movement2 = new Movement(51,49);\n\n assertThat(movement1.equals(movement2)).isEqualTo(false);\n }",
"class_me... | {
"fields": [
{
"declarator": "NO_MOVEMENT = new Movement( 0, 0)",
"modifier": "public static final",
"original_string": "public static final Movement NO_MOVEMENT = new Movement( 0, 0);",
"type": "Movement",
"var_name": "NO_MOVEMENT"
},
{
"declarator": "mRightWheelVeloc... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tMovement other = (Movement) obj;\n\t\tif (mLeftWheelVelocity != other.mLeftWheelVelocity)\n\t\t\treturn fals... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_61 | {
"fields": [
{
"declarator": "teamConverter = new TeamConverter()",
"modifier": "",
"original_string": "TeamConverter teamConverter = new TeamConverter();",
"type": "TeamConverter",
"var_name": "teamConverter"
}
],
"file": "mrbotkicore/src/test/java/core/TeamConverterTest.ja... | {
"body": "@Test\n public void testConvertWithValueIsGelb() throws Exception\n {\n TeamConverter teamConverter = new TeamConverter();\n BotInformation.Teams result = teamConverter.convert(\"gelb\");\n assertThat(result).isEqualTo(BotInformation.Teams.Yellow);\n }",
"class_method_signat... | {
"fields": [],
"file": "mrbotkicore/src/main/java/core/TeamConverter.java",
"identifier": "TeamConverter",
"interfaces": "implements CommandLine.ITypeConverter<BotInformation.Teams>",
"methods": [
{
"class_method_signature": "TeamConverter.convert(String value)",
"constructor": false,
"... | {
"body": "@Override\n public BotInformation.Teams convert(String value) throws Exception\n {\n if (value == \"gelb\" || value == \"yellow\" || value == \"g\" || value == \"y\")\n return Yellow;\n else if (value == \"blau\" || value == \"blue\" || value == \"b\")\n return Blu... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_60 | {
"fields": [
{
"declarator": "mockCommandLine = mock(CommandLine.class)",
"modifier": "",
"original_string": "CommandLine mockCommandLine = mock(CommandLine.class);",
"type": "CommandLine",
"var_name": "mockCommandLine"
}
],
"file": "mrbotkicore/src/test/java/core/CommandLin... | {
"body": "@Test\n public void testSetOptions()\n {\n String[] args = {\"-bn\",\"3\",\"-tn\",\"Northern Stars\",\"-t\",\"blau\",\"-ids\",\"13\",\"-s\",\"localhost:3310\",\"-aiarc\",\"../mrbotkiexample/bin/exampleai/brain\",\"-aicl\",\"exampleai.brain.Striker\",\"-aiarg\",\"0\"};\n CommandLineOptio... | {
"fields": [
{
"declarator": "help",
"modifier": "@Option(names={\"-h\", \"-help\", \"--help\"}, description=\"Diese Hilfe\", usageHelp=true)\n private",
"original_string": "@Option(names={\"-h\", \"-help\", \"--help\"}, description=\"Diese Hilfe\", usageHelp=true)\n private boolean help;... | {
"body": "private void setOptions() throws UnknownHostException\n {\n BotInformation botInformation = Core.getInstance().getBotinformation();\n\n botInformation.setAIClassname(this.aiClassname);\n botInformation.setAIArchive(this.aiArchive);\n botInformation.setAIArgs(Arrays.toString(t... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_37 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testAdd()\n {\n //Todo: Mock?\n ReferencePoint referencePoint = new ReferencePoint(50,20,false);\n ReferencePoint plusReferencePoint = new ReferencePoint(10,10, false);\n referencePoint.add(plusReferencePoint);\n assertThat(referencePoint.getXOfP... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public ReferencePoint add( ReferencePoint aReferencePoint ) {\n mX += aReferencePoint.mX;\n mY += aReferencePoint.mY;\n return set( mX, mY, false );\n }",
"class_method_signature": "ReferencePoint.add( ReferencePoint aReferencePoint )",
"constructor": false,
"full_... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_8 | {
"fields": [
{
"declarator": "mockMovement",
"modifier": "",
"original_string": "Movement mockMovement;",
"type": "Movement",
"var_name": "mockMovement"
}
],
"file": "mrbotkiessentials/src/test/java/essentials/communication/action_server2008/MovementTest.java",
"identifier... | {
"body": "@Test\n public void testEqualsWithDifferentClass()\n {\n Movement movement = new Movement(51,50);\n assertThat(movement.equals(new Integer(12))).isEqualTo(false);\n }",
"class_method_signature": "MovementTest.testEqualsWithDifferentClass()",
"constructor": false,
"full_signatur... | {
"fields": [
{
"declarator": "NO_MOVEMENT = new Movement( 0, 0)",
"modifier": "public static final",
"original_string": "public static final Movement NO_MOVEMENT = new Movement( 0, 0);",
"type": "Movement",
"var_name": "NO_MOVEMENT"
},
{
"declarator": "mRightWheelVeloc... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tMovement other = (Movement) obj;\n\t\tif (mLeftWheelVelocity != other.mLeftWheelVelocity)\n\t\t\treturn fals... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_21 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestWrongDistance() \n\t{\n\t\tfellowPlayerCompare = new FellowPlayer(5, \"Bob\", true, 130.8, 70.3, 0);\n\t\tassert(!fellowPlayerOriginal.equals(fellowPlayerCompare));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestWrongDistance()",
"constructor": false,
"fu... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_76 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartManagementWithNetworkConnectionAndNotAlive() {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( mNetworkCommunicationMock );\n\t\twhen(mCoreMock.getAI()).thenReturn( null );\n\t\t\n\t\tmSUT.startManagement();\n\t\t\n\t\tassertThat(mSUT.isAlive()).isTrue();\n\t\tverify(mL... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static FromServerManagement sINSTANCE;",
"type": "FromServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesFromServer = false",
"modifier"... | {
"body": "public void startManagement(){\n\n\t\tif( Core.getInstance().getServerConnection() == null ) {\n\n\t\t\tthrow new NullPointerException( \"NetworkCommunication cannot be NULL when starting FromServerManagement.\" ) ;\n\n\t\t} else if ( isAlive() ){\n\t\t\t\n\t\t\tthrow new IllegalThreadStateException( \"Fro... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_99 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartWithNetworkConnectionAndNotAlive() {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( mNetworkCommunicationMock );\n\t\twhen(mCoreMock.getAI()).thenReturn( null );\n\t\t\n\t\tmSUT.start();\n\t\t\n\t\tassertThat(mSUT.isAlive()).isTrue();\n\t\tverify(mLoggerMock).info(\"To... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ToServerManagement sINSTANCE;",
"type": "ToServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesToServer = false",
"modifier": "@Gu... | {
"body": "@Override\n\tpublic void start(){\n\t\t\n\t\tthis.startManagement();\n\t\t\n\t}",
"class_method_signature": "ToServerManagement.start()",
"constructor": false,
"full_signature": "@Override public void start()",
"identifier": "start",
"invocations": [
"startManagement"
],
"modifiers": "@Ov... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_83 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testRecieveMessagesWithAI() throws Exception {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( mNetworkCommunicationMock );\n\t\twhen(mCoreMock.getAI()).thenReturn( mArtificialIntelligenceMock );\n\t\tWorldData vTestData = RawWorldData.createRawWorldDataFromXML(\"<rawWorldData><... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static FromServerManagement sINSTANCE;",
"type": "FromServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesFromServer = false",
"modifier"... | {
"body": "public void startManagement(){\n\n\t\tif( Core.getInstance().getServerConnection() == null ) {\n\n\t\t\tthrow new NullPointerException( \"NetworkCommunication cannot be NULL when starting FromServerManagement.\" ) ;\n\n\t\t} else if ( isAlive() ){\n\t\t\t\n\t\t\tthrow new IllegalThreadStateException( \"Fro... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_4 | {
"fields": [
{
"declarator": "mockMovement",
"modifier": "",
"original_string": "Movement mockMovement;",
"type": "Movement",
"var_name": "mockMovement"
}
],
"file": "mrbotkiessentials/src/test/java/essentials/communication/action_server2008/MovementTest.java",
"identifier... | {
"body": "@Test\n public void testGetXMLString()\n {\n Movement movement = new Movement(51,50);\n assertThat(movement.getXMLString()).isEqualTo(\"<command> <wheel_velocities> <right>51</right> <left>50</left> </wheel_velocities> </command>\");\n }",
"class_method_signature": "MovementTest.te... | {
"fields": [
{
"declarator": "NO_MOVEMENT = new Movement( 0, 0)",
"modifier": "public static final",
"original_string": "public static final Movement NO_MOVEMENT = new Movement( 0, 0);",
"type": "Movement",
"var_name": "NO_MOVEMENT"
},
{
"declarator": "mRightWheelVeloc... | {
"body": "@Override\n\tpublic String getXMLString() {\n\t\treturn \"<command> <wheel_velocities> <right>\" + mRightWheelVelocity + \"</right> <left>\" + mLeftWheelVelocity + \"</left> </wheel_velocities> </command>\";\n\t}",
"class_method_signature": "Movement.getXMLString()",
"constructor": false,
"full_signa... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_95 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartManagementWithoutNetworkConnection() {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( null );\n\t\t\n\t\ttry{\n\t\t\tmSUT.startManagement();\n\t\t\tfail(\"Expected Nullpointerexception\");\n\t\t} catch( Exception vExpectedException ) {\n\t\t\tassertThat(vExpectedExcept... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ToServerManagement sINSTANCE;",
"type": "ToServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesToServer = false",
"modifier": "@Gu... | {
"body": "public void startManagement(){\n\t\t\n\t\tif( Core.getInstance().getServerConnection() == null ) {\n\t\t\t\n\t\t\tthrow new NullPointerException( \"NetworkCommunication cannot be NULL when starting ToServerManagement.\" ) ;\n\t\t\t\n\t\t} else if ( isAlive() ){\n\t\t\t\n\t\t\tthrow new IllegalThreadStateEx... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_56 | {
"fields": [],
"file": "mrbotkinetwork/src/test/java/fwns_network/universal/NetworkCommunicationTest.java",
"identifier": "NetworkCommunicationTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testSendDatagramm()\n\t{\n\n\t}",
"class_method_signature": "NetworkCommunicationTest.testSendDatagramm()",
"constructor": false,
"full_signature": "@Test public void testSendDatagramm()",
"identifier": "testSendDatagramm",
"invocations": [],
"modifiers": "@Test public",
... | {
"fields": [
{
"declarator": "mSocketInitialized = false",
"modifier": "protected",
"original_string": "protected boolean mSocketInitialized = false;",
"type": "boolean",
"var_name": "mSocketInitialized"
},
{
"declarator": "MAX_DATAGRAM_LENGTH = 16384",
"modifier... | {
"body": "public void sendDatagramm( String aData ) throws IOException\n\t{\n\t\t\n\t\tmDataPaket.setData( aData.getBytes() );\n\t\tmToServerSocket.send( mDataPaket );\n\n\t}",
"class_method_signature": "NetworkCommunication.sendDatagramm( String aData )",
"constructor": false,
"full_signature": "public void s... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_40 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEpsilonEqualsReferencePointNotExactCorrect()\n {\n ReferencePoint referencePoint = new ReferencePoint(50,20,false);\n Boolean result = referencePoint.epsilonEquals(new ReferencePoint(51,19,false),2);\n assertThat(result).isEqualTo(true);\n }",
"class_... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public boolean epsilonEquals ( ReferencePoint aReferencePoint, double aEpsilon )\n {\n\n return aReferencePoint != null\n && (Math.abs(aReferencePoint.getXOfPoint() - mX) <= aEpsilon)\n && (Math.abs(aReferencePoint.getYOfPoint() - mY) <= aEpsilon);\n\n }",
"clas... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_17 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestWrongClass() \n\t{\n\t\tRawWorldData rwd = new RawWorldData();\n\t\tassert(!fellowPlayerOriginal.equals(rwd));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestWrongClass()",
"constructor": false,
"full_signature": "@Test public void equalsTestWrongClass()",... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_71 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void mainWithFatalError() {\n\t\tString[] vEmptyCommandline = new String[0];\n\t\tRuntimeException vTestException = new RuntimeException();\n\t\tdoThrow(vTestException).when(mCoreMock).startBot(vEmptyCommandline);\n\t\t\n\t\tMain.main(vEmptyCommandline);\n\t\t\n\t\tverify(mCoreMock).startBo... | {
"fields": [],
"file": "mrbotkicore/src/main/java/core/Main.java",
"identifier": "Main",
"interfaces": "",
"methods": [
{
"class_method_signature": "Main.main( String[] aCommandline )",
"constructor": false,
"full_signature": "public static void main( String[] aCommandline )",
"id... | {
"body": "public static void main( String[] aCommandline ) {\n \n System.setProperty(\"Bot\", ManagementFactory.getRuntimeMXBean().getName() + \"\" );\n Core.getLogger().info(\"Starting Bot(\" + ManagementFactory.getRuntimeMXBean().getName() + \")\" );\n \n StringBuilder vParameter... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_26 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestNoNicknameBoth() \n\t{\n\t\tfellowPlayerCompare = new FellowPlayer(5, null, true, 130.7, 70.3, 0);\n\t\tFellowPlayer fellowPlayerOriginalLocal = new FellowPlayer(5, null, true, 130.7, 70.3, 0);\n\t\tassert(fellowPlayerOriginalLocal.equals(fellowPlayerCompare));\n\t}",
"cl... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_30 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void setPointNameText()\n\t{\n\t\tFellowPlayer fellowPlayer = new FellowPlayer();\n\t\tint IDCountBefore = FellowPlayer.IDCOUNTER ;\n\t\tfellowPlayer.setPointName(ReferencePointName.Ball);\n\t\tint IDCountAfter = FellowPlayer.IDCOUNTER;\n\t\tassert(IDCountBefore+1==IDCountAfter);\n\t\t\n\t}... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n void setPointName( ReferencePointName aPointName ) {\n \n super.setPointName( ReferencePointName.Player );\n mId = IDCOUNTER++;\n \n }",
"class_method_signature": "FellowPlayer.setPointName( ReferencePointName aPointName )",
"constructor": false,
"full_si... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_67 | {
"fields": [
{
"declarator": "teamConverter = new TeamConverter()",
"modifier": "",
"original_string": "TeamConverter teamConverter = new TeamConverter();",
"type": "TeamConverter",
"var_name": "teamConverter"
}
],
"file": "mrbotkicore/src/test/java/core/TeamConverterTest.ja... | {
"body": "@Test\n public void testConvertWithValueIsB() throws Exception\n {\n TeamConverter teamConverter = new TeamConverter();\n BotInformation.Teams result = teamConverter.convert(\"b\");\n assertThat(result).isEqualTo(BotInformation.Teams.Blue);\n }",
"class_method_signature": "T... | {
"fields": [],
"file": "mrbotkicore/src/main/java/core/TeamConverter.java",
"identifier": "TeamConverter",
"interfaces": "implements CommandLine.ITypeConverter<BotInformation.Teams>",
"methods": [
{
"class_method_signature": "TeamConverter.convert(String value)",
"constructor": false,
"... | {
"body": "@Override\n public BotInformation.Teams convert(String value) throws Exception\n {\n if (value == \"gelb\" || value == \"yellow\" || value == \"g\" || value == \"y\")\n return Yellow;\n else if (value == \"blau\" || value == \"blue\" || value == \"b\")\n return Blu... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_88 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartWhileAlive() {\n\t\twhen(mCoreMock.getAI()).thenReturn( null );\n\t\t\n\t\tmSUT.start();\n\t\tassertThat(mSUT.isAlive()).isTrue();\n\t\t\n\t\tmSUT.start();\n\t\tassertThat(mSUT.isAlive()).isTrue();\n\t\tverify(mLoggerMock, times(1)).info(\"RestartAiServerManagement started.\")... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ReloadAiManagement sINSTANCE;",
"type": "ReloadAiManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mAiActive = false",
"modifier": "private",
"... | {
"body": "@Override\n\tpublic void start(){\n\t\t\n\t\tstartManagement();\n\t\t\n\t}",
"class_method_signature": "ReloadAiManagement.start()",
"constructor": false,
"full_signature": "@Override public void start()",
"identifier": "start",
"invocations": [
"startManagement"
],
"modifiers": "@Overrid... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_101 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStopManagementWhenNotAlive() {\n\t\t\n\t\tassertThat(mSUT.isAlive()).isFalse();\n\t\tmSUT.stopManagement();\n\t\tassertThat(mSUT.isAlive()).isFalse();\n\t\tverify(mLoggerMock, never()).info(\"ToServerManagement stopped.\");\n\t\t\n\t}",
"class_method_signature": "ToServerManageme... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ToServerManagement sINSTANCE;",
"type": "ToServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesToServer = false",
"modifier": "@Gu... | {
"body": "public void stopManagement(){\n\t \n\t synchronized (this) {\n \n\t mManageMessagesToServer = false;\n\t \n\t }\n\t \n\t if( isAlive()){\n\t \n\t \tresumeManagement();\n\t \t\n while(isAlive()){ \n try {\n Thread.sleep... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_10 | {
"fields": [
{
"declarator": "mockMovement",
"modifier": "",
"original_string": "Movement mockMovement;",
"type": "Movement",
"var_name": "mockMovement"
}
],
"file": "mrbotkiessentials/src/test/java/essentials/communication/action_server2008/MovementTest.java",
"identifier... | {
"body": "@Test\n public void testEqualsWithDifferentRightWheelVelocity()\n {\n Movement movement1 = new Movement(51,50);\n Movement movement2 = new Movement(49,50);\n\n assertThat(movement1.equals(movement2)).isEqualTo(false);\n }",
"class_method_signature": "MovementTest.testEqualsW... | {
"fields": [
{
"declarator": "NO_MOVEMENT = new Movement( 0, 0)",
"modifier": "public static final",
"original_string": "public static final Movement NO_MOVEMENT = new Movement( 0, 0);",
"type": "Movement",
"var_name": "NO_MOVEMENT"
},
{
"declarator": "mRightWheelVeloc... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tMovement other = (Movement) obj;\n\t\tif (mLeftWheelVelocity != other.mLeftWheelVelocity)\n\t\t\treturn fals... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_47 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEpsilonEqualsDoubleExactIsTrue()\n {\n ReferencePoint referencePoint = new ReferencePoint(50,20,false);\n Boolean result = referencePoint.epsilonEquals(50.0,20.0,0);\n assertThat(result).isEqualTo(true);\n }",
"class_method_signature": "ReferencePoint... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public boolean epsilonEquals ( ReferencePoint aReferencePoint, double aEpsilon )\n {\n\n return aReferencePoint != null\n && (Math.abs(aReferencePoint.getXOfPoint() - mX) <= aEpsilon)\n && (Math.abs(aReferencePoint.getYOfPoint() - mY) <= aEpsilon);\n\n }",
"clas... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_51 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEqualsObjectIsOtherClass()\n {\n ReferencePoint referencePoint = new ReferencePoint();\n Boolean result = referencePoint.equals(new Double(1.2));\n assertThat(result).isEqualTo(false);\n }",
"class_method_signature": "ReferencePointTest.testEqualsObje... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tReferencePoint other = (ReferencePoint) obj;\n\t\tif (Double.doubleToLongBits(mAngleToPoint) != Double.doubl... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_92 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testRunWithoutAI() throws Exception {\n\t\twhen(mCoreMock.getAI()).thenReturn( null );\n\t\t\n\t\tmSUT.startManagement();\n\t\tassertThat(mSUT.isAlive()).isTrue();\n\t}",
"class_method_signature": "ReloadAiManagementTest.testRunWithoutAI()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ReloadAiManagement sINSTANCE;",
"type": "ReloadAiManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mAiActive = false",
"modifier": "private",
"... | {
"body": "public void startManagement(){\n\t \n\t if( !isAlive() ){\n\t \n\t mAiActive = true;\n\t super.start();\n\t Core.getLogger().info( \"RestartAiServerManagement started.\" );\n\t \n\t }\n \n\t}",
"class_method_signature": "ReloadAiManagement.startManagement()",
... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_3 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/action_server2008/KickTest.java",
"identifier": "KickTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void getXMLString() throws Exception\n {\n Kick kick = new Kick(90.1, (float) 21.0);\n assertThat(kick.getXMLString()).isEqualTo(\"<command> <kick> <angle>90.1</angle> <force>21.0</force> </kick> </command>\");\n\n }",
"class_method_signature": "KickTest.getXMLString... | {
"fields": [
{
"declarator": "mAngle",
"modifier": "private final",
"original_string": "private final double mAngle;",
"type": "double",
"var_name": "mAngle"
},
{
"declarator": "mForce",
"modifier": "private final",
"original_string": "private final float m... | {
"body": "@Override\n\tpublic String getXMLString() {\n\t\treturn \"<command> <kick> <angle>\" + mAngle + \"</angle> <force>\" + mForce + \"</force> </kick> </command>\";\n\t}",
"class_method_signature": "Kick.getXMLString()",
"constructor": false,
"full_signature": "@Override public String getXMLString()",
... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_84 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testLoseServerConnectionWhileRecievingMessages() throws Exception {\n\t\twhen(mCoreMock.getServerConnection()).thenReturn( mNetworkCommunicationMock );\n\t\twhen(mCoreMock.getAI()).thenReturn( mArtificialIntelligenceMock );\n\t\tdoReturn(new RawWorldData().toXMLString()).when(mNetworkC... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static FromServerManagement sINSTANCE;",
"type": "FromServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesFromServer = false",
"modifier"... | {
"body": "public void startManagement(){\n\n\t\tif( Core.getInstance().getServerConnection() == null ) {\n\n\t\t\tthrow new NullPointerException( \"NetworkCommunication cannot be NULL when starting FromServerManagement.\" ) ;\n\n\t\t} else if ( isAlive() ){\n\t\t\t\n\t\t\tthrow new IllegalThreadStateException( \"Fro... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_85 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testStartManagementWhileNotAlive() {\n\t\twhen(mCoreMock.getAI()).thenReturn( null );\n\t\tassertThat(mSUT.isAlive()).isFalse();\n\t\t\n\t\tmSUT.startManagement();\n\t\t\n\t\tassertThat(mSUT.isAlive()).isTrue();\n\t\tverify(mLoggerMock).info(\"RestartAiServerManagement started.\");\n\t... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ReloadAiManagement sINSTANCE;",
"type": "ReloadAiManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mAiActive = false",
"modifier": "private",
"... | {
"body": "public void startManagement(){\n\t \n\t if( !isAlive() ){\n\t \n\t mAiActive = true;\n\t super.start();\n\t Core.getLogger().info( \"RestartAiServerManagement started.\" );\n\t \n\t }\n \n\t}",
"class_method_signature": "ReloadAiManagement.startManagement()",
... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_2 | {
"fields": [
{
"declarator": "mockBotInformation = mock(BotInformation.class)",
"modifier": "",
"original_string": "BotInformation mockBotInformation = mock(BotInformation.class);",
"type": "BotInformation",
"var_name": "mockBotInformation"
},
{
"declarator": "mockInet... | {
"body": "@Test\n public void testGetGamevalueNamesAsStringArray()\n {\n int i = 0;\n String[] gvStrings= new String[BotInformation.GamevalueNames.values().length];\n for ( BotInformation.GamevalueNames vGamevalueName : BotInformation.GamevalueNames.values() )\n {\n gvStr... | {
"fields": [
{
"declarator": "sBOTINFORMATIONLOGGER = LogManager.getLogger(\"BOTINFORMATION\")",
"modifier": "private static",
"original_string": "private static Logger sBOTINFORMATIONLOGGER = LogManager.getLogger(\"BOTINFORMATION\");",
"type": "Logger",
"var_name": "sBOTINFORMATION... | {
"body": "public synchronized String toString() {\n\n String vBotInformationString = \"Bot \" + getBotname() + \"(\" + getRcId() + \"/\" + getVtId() + \")\\n\";\n vBotInformationString += \"with Address: \" + getBotIP().toString() + \" Port: \" + getBotPort();\n vBotInformationString += getRecon... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_93 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testRunWithAIAndNoNeedToRestart() throws Exception {\n\t\twhen(mCoreMock.getAI()).thenReturn( mArtificialIntelligenceMock );\n\t\twhen(mArtificialIntelligenceMock.wantRestart()).thenReturn(false);\n\t\t\n\t\tmSUT.startManagement();\n\t\tassertThat(mSUT.isAlive()).isTrue();\n\n\t\tawait... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ReloadAiManagement sINSTANCE;",
"type": "ReloadAiManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mAiActive = false",
"modifier": "private",
"... | {
"body": "public void startManagement(){\n\t \n\t if( !isAlive() ){\n\t \n\t mAiActive = true;\n\t super.start();\n\t Core.getLogger().info( \"RestartAiServerManagement started.\" );\n\t \n\t }\n \n\t}",
"class_method_signature": "ReloadAiManagement.startManagement()",
... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_50 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEqualsObjectIsNull()\n {\n ReferencePoint referencePoint = new ReferencePoint();\n Boolean result = referencePoint.equals(null);\n assertThat(result).isEqualTo(false);\n }",
"class_method_signature": "ReferencePointTest.testEqualsObjectIsNull()",
"c... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tReferencePoint other = (ReferencePoint) obj;\n\t\tif (Double.doubleToLongBits(mAngleToPoint) != Double.doubl... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_46 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEpsilonEqualsDoubleNotExactIsFalse()\n {\n ReferencePoint referencePoint = new ReferencePoint(50,20,false);\n Boolean result = referencePoint.epsilonEquals(50.0,0.0,1);\n assertThat(result).isEqualTo(false);\n }",
"class_method_signature": "ReferenceP... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public boolean epsilonEquals ( ReferencePoint aReferencePoint, double aEpsilon )\n {\n\n return aReferencePoint != null\n && (Math.abs(aReferencePoint.getXOfPoint() - mX) <= aEpsilon)\n && (Math.abs(aReferencePoint.getYOfPoint() - mY) <= aEpsilon);\n\n }",
"clas... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_100 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testGetInstance() {\n\t\tToServerManagement vSaveToCompare = ToServerManagement.getInstance();\n\t\t\n\t\tassertThat(vSaveToCompare).isInstanceOf(ToServerManagement.class);\n\t\tassertThat(vSaveToCompare).isEqualTo(ToServerManagement.getInstance());\n\t}",
"class_method_signature": "... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ToServerManagement sINSTANCE;",
"type": "ToServerManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mManageMessagesToServer = false",
"modifier": "@Gu... | {
"body": "public static ToServerManagement getInstance() {\n \n if( ToServerManagement.sINSTANCE == null){\n ToServerManagement.sINSTANCE = new ToServerManagement();\n }\n \n return ToServerManagement.sINSTANCE;\n \n }",
"class_method_signature": "ToServerMan... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_11 | {
"fields": [
{
"declarator": "mockMovement",
"modifier": "",
"original_string": "Movement mockMovement;",
"type": "Movement",
"var_name": "mockMovement"
}
],
"file": "mrbotkiessentials/src/test/java/essentials/communication/action_server2008/MovementTest.java",
"identifier... | {
"body": "@Test\n public void testEqualsWithSameValues()\n {\n Movement movement1 = new Movement(50,50);\n Movement movement2 = new Movement(50,50);\n\n assertThat(movement1.equals(movement2)).isEqualTo(true);\n }",
"class_method_signature": "MovementTest.testEqualsWithSameValues()",
... | {
"fields": [
{
"declarator": "NO_MOVEMENT = new Movement( 0, 0)",
"modifier": "public static final",
"original_string": "public static final Movement NO_MOVEMENT = new Movement( 0, 0);",
"type": "Movement",
"var_name": "NO_MOVEMENT"
},
{
"declarator": "mRightWheelVeloc... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tMovement other = (Movement) obj;\n\t\tif (mLeftWheelVelocity != other.mLeftWheelVelocity)\n\t\t\treturn fals... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_66 | {
"fields": [
{
"declarator": "teamConverter = new TeamConverter()",
"modifier": "",
"original_string": "TeamConverter teamConverter = new TeamConverter();",
"type": "TeamConverter",
"var_name": "teamConverter"
}
],
"file": "mrbotkicore/src/test/java/core/TeamConverterTest.ja... | {
"body": "@Test\n public void testConvertWithValueIsBlue() throws Exception\n {\n TeamConverter teamConverter = new TeamConverter();\n BotInformation.Teams result = teamConverter.convert(\"blue\");\n assertThat(result).isEqualTo(BotInformation.Teams.Blue);\n }",
"class_method_signatur... | {
"fields": [],
"file": "mrbotkicore/src/main/java/core/TeamConverter.java",
"identifier": "TeamConverter",
"interfaces": "implements CommandLine.ITypeConverter<BotInformation.Teams>",
"methods": [
{
"class_method_signature": "TeamConverter.convert(String value)",
"constructor": false,
"... | {
"body": "@Override\n public BotInformation.Teams convert(String value) throws Exception\n {\n if (value == \"gelb\" || value == \"yellow\" || value == \"g\" || value == \"y\")\n return Yellow;\n else if (value == \"blau\" || value == \"blue\" || value == \"b\")\n return Blu... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_89 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void testGetInstance() {\n\t\tReloadAiManagement vSaveToCompare = ReloadAiManagement.getInstance();\n\t\t\n\t\tassertThat(vSaveToCompare).isInstanceOf(ReloadAiManagement.class);\n\t\tassertThat(vSaveToCompare).isEqualTo(ReloadAiManagement.getInstance());\n\t}",
"class_method_signature": "... | {
"fields": [
{
"declarator": "sINSTANCE",
"modifier": "private static",
"original_string": "private static ReloadAiManagement sINSTANCE;",
"type": "ReloadAiManagement",
"var_name": "sINSTANCE"
},
{
"declarator": "mAiActive = false",
"modifier": "private",
"... | {
"body": "public static ReloadAiManagement getInstance() {\n \n if( ReloadAiManagement.sINSTANCE == null){\n ReloadAiManagement.sINSTANCE = new ReloadAiManagement();\n }\n \n return ReloadAiManagement.sINSTANCE;\n \n }",
"class_method_signature": "ReloadAiMan... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_31 | {
"fields": [],
"file": "mrbotkiessentials/src/test/java/essentials/communication/worlddata_server2008/ReferencePointTest.java",
"identifier": "ReferencePointTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSetXOfPoint()\n {\n ReferencePoint referencePoint = new ReferencePoint();\n referencePoint.setXOfPoint(10);\n assertThat(referencePoint.getXOfPoint()).isCloseTo(10, Percentage.withPercentage(1));\n }",
"class_method_signature": "ReferencePointTest.tes... | {
"fields": [
{
"declarator": "mPointName = ReferencePointName.NoFixedName",
"modifier": "private",
"original_string": "private ReferencePointName mPointName = ReferencePointName.NoFixedName;",
"type": "ReferencePointName",
"var_name": "mPointName"
},
{
"declarator": "m... | {
"body": "public void setXOfPoint( double aXValue ) {\n\n mX = aXValue;\n set( mX, mY, false );\n \n }",
"class_method_signature": "ReferencePoint.setXOfPoint( double aXValue )",
"constructor": false,
"full_signature": "public void setXOfPoint( double aXValue )",
"identifier": "setXOf... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_27 | {
"fields": [
{
"declarator": "fellowPlayerOriginal",
"modifier": "",
"original_string": "FellowPlayer fellowPlayerOriginal;",
"type": "FellowPlayer",
"var_name": "fellowPlayerOriginal"
},
{
"declarator": "fellowPlayerCompare",
"modifier": "",
"original_stri... | {
"body": "@Test\n\tpublic void equalsTestNoStatus() \n\t{\n\t\tfellowPlayerCompare = new FellowPlayer(5, \"Bob\", null, 130.7, 70.3, 0);\n\t\tassert(!fellowPlayerOriginal.equals(fellowPlayerCompare));\n\t}",
"class_method_signature": "FellowPlayerTest.equalsTestNoStatus()",
"constructor": false,
"full_signatu... | {
"fields": [
{
"declarator": "mId",
"modifier": "private",
"original_string": "private int mId;",
"type": "int",
"var_name": "mId"
},
{
"declarator": "mNickname",
"modifier": "@XmlElement(name=\"nickname\")",
"original_string": "@XmlElement(name=\"nickname\... | {
"body": "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (!super.equals(obj))\n\t\t\treturn false;\n\t\tFellowPlayer other = (FellowPlayer) obj;\n\t\tif (mId != other.mId)\n\t\t\treturn false;\n\t\tif (mNickname == null) \n\t\t{\n\t\t\tif (other.mNickname != null)\... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
9004636_70 | {
"fields": [
{
"declarator": "mCoreMock = mock(Core.class)",
"modifier": "",
"original_string": "Core mCoreMock = mock(Core.class);",
"type": "Core",
"var_name": "mCoreMock"
},
{
"declarator": "mLoggerMock = mock(Logger.class)",
"modifier": "",
"original_st... | {
"body": "@Test\n\tpublic void mainWithACommandline() {\n\t\tString[] vCommandline = new String[5];\n\t\tvCommandline[0] = \"Hello,\";\n\t\tvCommandline[1] = \"this\";\n\t\tvCommandline[2] = \"is\";\n\t\tvCommandline[3] = \"a\";\n\t\tvCommandline[4] = \"test.\";\n\t\tdoNothing().when(mCoreMock).startBot(vCommandline... | {
"fields": [],
"file": "mrbotkicore/src/main/java/core/Main.java",
"identifier": "Main",
"interfaces": "",
"methods": [
{
"class_method_signature": "Main.main( String[] aCommandline )",
"constructor": false,
"full_signature": "public static void main( String[] aCommandline )",
"id... | {
"body": "public static void main( String[] aCommandline ) {\n \n System.setProperty(\"Bot\", ManagementFactory.getRuntimeMXBean().getName() + \"\" );\n Core.getLogger().info(\"Starting Bot(\" + ManagementFactory.getRuntimeMXBean().getName() + \")\" );\n \n StringBuilder vParameter... | {
"created": null,
"fork": null,
"fork_count": 2,
"is_fork": false,
"language": "Java",
"license": "Other",
"repo_id": 9004636,
"size": 21952,
"stargazer_count": 6,
"stars": null,
"updates": null,
"url": "https://github.com/NorthernStars/MR-FWNS"
} |
114698912_0 | {
"fields": [],
"file": "lang/java/src/test/java/ru/dz/mqtt_udp/TopicFilterTest.java",
"identifier": "TopicFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPlain() \n\t{\n\t\tTopicFilter tf = new TopicFilter(\"aaa/ccc/bbb\");\n\t\tassertTrue( tf.test(\"aaa/ccc/bbb\") );\n\t\tassertFalse( tf.test(\"aaa/c/bbb\") );\n\t\tassertFalse( tf.test(\"aaa/ccccc/bbb\") );\n\t\tassertFalse( tf.test(\"aaa/ccccc/ccc\") );\n\t}",
"class_method_sign... | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private String filter;",
"type": "String",
"var_name": "filter"
}
],
"file": "lang/java/src/main/java/ru/dz/mqtt_udp/TopicFilter.java",
"identifier": "TopicFilter",
"interfaces": "implement... | {
"body": "@Override\n\tpublic boolean test(String topicName) {\n\t\t\n\t\tint tc = 0;\n\t\tint fc = 0;\n\t\t\n\t\twhile(true)\n\t\t{\n\t\t\t// begin of path part\n\t\t\t\n\t\t\tif( filter.charAt(fc) == '+')\n\t\t\t{\n\t\t\t\tfc++; // eat +\n\t\t\t\t// matches one path part, skip all up to / or end in topic\n\t\t\t\t... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 114698912,
"size": 11659,
"stargazer_count": 83,
"stars": null,
"updates": null,
"url": "https://github.com/dzavalishin/mqtt_udp"
} |
114698912_1 | {
"fields": [],
"file": "lang/java/src/test/java/ru/dz/mqtt_udp/TopicFilterTest.java",
"identifier": "TopicFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPlus() \n\t{\n\t\tTopicFilter tf = new TopicFilter(\"aaa/+/bbb\");\n\t\tassertTrue( tf.test(\"aaa/ccc/bbb\") );\n\t\tassertTrue( tf.test(\"aaa/c/bbb\") );\n\t\tassertTrue( tf.test(\"aaa/ccccc/bbb\") );\n\t\tassertFalse( tf.test(\"aaa/ccccc/ccc\") );\n\t}",
"class_method_signature... | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private String filter;",
"type": "String",
"var_name": "filter"
}
],
"file": "lang/java/src/main/java/ru/dz/mqtt_udp/TopicFilter.java",
"identifier": "TopicFilter",
"interfaces": "implement... | {
"body": "@Override\n\tpublic boolean test(String topicName) {\n\t\t\n\t\tint tc = 0;\n\t\tint fc = 0;\n\t\t\n\t\twhile(true)\n\t\t{\n\t\t\t// begin of path part\n\t\t\t\n\t\t\tif( filter.charAt(fc) == '+')\n\t\t\t{\n\t\t\t\tfc++; // eat +\n\t\t\t\t// matches one path part, skip all up to / or end in topic\n\t\t\t\t... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 114698912,
"size": 11659,
"stargazer_count": 83,
"stars": null,
"updates": null,
"url": "https://github.com/dzavalishin/mqtt_udp"
} |
114698912_2 | {
"fields": [],
"file": "lang/java/src/test/java/ru/dz/mqtt_udp/TopicFilterTest.java",
"identifier": "TopicFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testSharp() \n\t{\n\t\tTopicFilter tf = new TopicFilter(\"aaa/#\");\n\t\tassertTrue( tf.test(\"aaa/ccc/bbb\") );\n\t\tassertTrue( tf.test(\"aaa/c/bbb\") );\n\t\tassertTrue( tf.test(\"aaa/ccccc/bbb\") );\n\t\tassertFalse( tf.test(\"aba/ccccc/ccc\") );\n\t}",
"class_method_signature": ... | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private String filter;",
"type": "String",
"var_name": "filter"
}
],
"file": "lang/java/src/main/java/ru/dz/mqtt_udp/TopicFilter.java",
"identifier": "TopicFilter",
"interfaces": "implement... | {
"body": "@Override\n\tpublic boolean test(String topicName) {\n\t\t\n\t\tint tc = 0;\n\t\tint fc = 0;\n\t\t\n\t\twhile(true)\n\t\t{\n\t\t\t// begin of path part\n\t\t\t\n\t\t\tif( filter.charAt(fc) == '+')\n\t\t\t{\n\t\t\t\tfc++; // eat +\n\t\t\t\t// matches one path part, skip all up to / or end in topic\n\t\t\t\t... | {
"created": null,
"fork": null,
"fork_count": 13,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 114698912,
"size": 11659,
"stargazer_count": 83,
"stars": null,
"updates": null,
"url": "https://github.com/dzavalishin/mqtt_udp"
} |
3645037_1 | {
"fields": [
{
"declarator": "TIME_OUT = 250",
"modifier": "private static final",
"original_string": "private static final int TIME_OUT = 250;",
"type": "int",
"var_name": "TIME_OUT"
},
{
"declarator": "storage = new ProxyGrantingTicketStorageImpl(TIME_OUT)",
"m... | {
"body": "@Test\n public void cleanUp() throws Exception {\n final String proxyGrantingTicketIou = \"proxyGrantingTicketIou\";\n\n final int timeout = 250;\n this.storage.save(proxyGrantingTicketIou, \"proxyGrantingTicket\");\n\n // sleep long enough for the ticket to timeout\n ... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "DEFAULT_TIMEOUT... | {
"body": "@Override\n public void cleanUp() {\n for (final Map.Entry<String, ProxyGrantingTicketHolder> holder : this.cache.entrySet()) {\n if (holder.getValue().isExpired(this.timeout)) {\n this.cache.remove(holder.getKey());\n }\n }\n }",
"class_method_sig... | {
"created": "3/7/2012 2:29:34 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3645037,
"size": null,
"stargazer_count": null,
"stars": 632,
"updates": "2020-01-20T20:34:17+00:00",
"url": "https://github.com/apereo/java-cas-cl... |
3645037_0 | {
"fields": [],
"file": "cas-client-support-saml/src/test/java/org/jasig/cas/client/util/SamlUtilsTest.java",
"identifier": "SamlUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseUtcDate() {\n final Date expected = new Date(1424437961025L);\n assertEquals(expected, SamlUtils.parseUtcDate(\"2015-02-20T08:12:41.025-0500\"));\n }",
"class_method_signature": "SamlUtilsTest.testParseUtcDate()",
"constructor": false,
"full_signature"... | {
"fields": [
{
"declarator": "ISO_FORMAT = ISODateTimeFormat.dateTimeNoMillis()",
"modifier": "private static final",
"original_string": "private static final DateTimeFormatter ISO_FORMAT = ISODateTimeFormat.dateTimeNoMillis();",
"type": "DateTimeFormatter",
"var_name": "ISO_FORMAT"... | {
"body": "public static Date parseUtcDate(final String date) {\n if (CommonUtils.isEmpty(date)) {\n return null;\n }\n return ISODateTimeFormat.dateTimeParser().parseDateTime(date).toDate();\n }",
"class_method_signature": "SamlUtils.parseUtcDate(final String date)",
"construct... | {
"created": "3/7/2012 2:29:34 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3645037,
"size": null,
"stargazer_count": null,
"stars": 632,
"updates": "2020-01-20T20:34:17+00:00",
"url": "https://github.com/apereo/java-cas-cl... |
3645037_2 | {
"fields": [
{
"declarator": "TIME_OUT = 250",
"modifier": "private static final",
"original_string": "private static final int TIME_OUT = 250;",
"type": "int",
"var_name": "TIME_OUT"
},
{
"declarator": "storage = new ProxyGrantingTicketStorageImpl(TIME_OUT)",
"m... | {
"body": "@Test\n public void nullPGTIOU() {\n Assert.assertNull(this.storage.retrieve(null));\n }",
"class_method_signature": "ProxyGrantingTicketStorageImplTest.nullPGTIOU()",
"constructor": false,
"full_signature": "@Test public void nullPGTIOU()",
"identifier": "nullPGTIOU",
"invocations":... | {
"fields": [
{
"declarator": "logger = LoggerFactory.getLogger(getClass())",
"modifier": "private final",
"original_string": "private final Logger logger = LoggerFactory.getLogger(getClass());",
"type": "Logger",
"var_name": "logger"
},
{
"declarator": "DEFAULT_TIMEOUT... | {
"body": "@Override\n public String retrieve(final String proxyGrantingTicketIou) {\n if (CommonUtils.isBlank(proxyGrantingTicketIou)) {\n return null;\n }\n\n final ProxyGrantingTicketHolder holder = this.cache.get(proxyGrantingTicketIou);\n\n if (holder == null) {\n ... | {
"created": "3/7/2012 2:29:34 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3645037,
"size": null,
"stargazer_count": null,
"stars": 632,
"updates": "2020-01-20T20:34:17+00:00",
"url": "https://github.com/apereo/java-cas-cl... |
107386062_18 | {
"fields": [],
"file": "caravan-common/src/test/java/com/ctrip/soa/caravan/common/value/corrector/PatternCorrectorTest.java",
"identifier": "PatternCorrectorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void mailTest() {\n PatternCorrector pc = new PatternCorrector(Patterns.MAIL_ADDRESS);\n assertNotNull(pc.correct(\"chennan@ctrip.com\"));\n assertNull(pc.correct(\"chennan\"));\n assertNull(pc.correct(\"@\"));\n assertNull(pc.correct(\"ctrip.com\"));\n ... | {
"fields": [
{
"declarator": "_pattern",
"modifier": "private",
"original_string": "private Pattern _pattern;",
"type": "Pattern",
"var_name": "_pattern"
}
],
"file": "caravan-common/src/main/java/com/ctrip/soa/caravan/common/value/corrector/PatternCorrector.java",
"identi... | {
"body": "@Override\n public String correct(String value) {\n if (Strings.isNullOrEmpty(value))\n return null;\n Matcher matcher = _pattern.matcher(value);\n if (matcher.matches())\n return value;\n else\n return null;\n }",
"class_method_signature... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_34 | {
"fields": [
{
"declarator": "managerId = \"soa\"",
"modifier": "static final",
"original_string": "static final String managerId = \"soa\";",
"type": "String",
"var_name": "managerId"
},
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.clas... | {
"body": "@Test\n public void updateServerList_FirstTimeNotPing_Test() {\n int serverCount = 10;\n final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName();\n final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId);\n\n final... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class)",
"modifier": "private static",
"original_string": "private static Logger _logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class);",
"type": "Logger",
"var_name": "_logger"
... | {
"body": "@Override\n public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) {\n if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains()))\n return null;\n\n HashMap<String, LoadBalancer... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_22 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/ServerTest.java",
"identifier": "ServerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serverEquals_ServerId_CaseInsensitive_Test() {\n Server server1 = Server.newBuilder().setServerId(\"Abc\").build();\n Server server2 = Server.newBuilder().setServerId(\"abc\").build();\n Assert.assertEquals(server1, server2);\n Assert.assertEquals(server2,... | {
"fields": [
{
"declarator": "serverId",
"modifier": "private",
"original_string": "private String serverId;",
"type": "String",
"var_name": "serverId"
},
{
"declarator": "isAlive = true",
"modifier": "private",
"original_string": "private boolean isAlive =... | {
"body": "public static Builder newBuilder() {\n return new Builder();\n }",
"class_method_signature": "Server.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_14 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/cached/DefaultCachedPropertyTest.java",
"identifier": "DefaultCachedPropertyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRefresh() {\n MyProperty mp = new MyProperty(\"k1\", \"v1\");\n DefaultCachedProperty dcp = new DefaultCachedProperty(mp);\n dcp.refresh();\n }",
"class_method_signature": "DefaultCachedPropertyTest.testRefresh()",
"constructor": false,
"full_signatu... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultCachedProperty.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(DefaultCachedProperty.class);",
"type": "Logger",
"var_name": "_logger... | {
"body": "@Override\n public void refresh() {\n String before = value();\n _value = super.value();\n\n if (Objects.equal(before, _value))\n return;\n\n if (_disableRefreshLog)\n return;\n\n _logger.info(\n String.format(\"Default cached prope... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_6 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/typed/DefaultTypedConfigurationManagerTest.java",
"identifier": "DefaultTypedConfigurationManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testListAbnormal() {\n MyConfigurationManager myManager = new MyConfigurationManager();\n DefaultTypedProperty<List<String>> p = (DefaultTypedProperty<List<String>>) myManager.getProperty(\"list\", \"lKey\", \"1112,,,2345,,12341,,, \");\n assertTrue(p.typedValue... | {
"fields": [],
"file": "caravan-configuration/src/main/java/com/ctrip/soa/caravan/configuration/typed/DefaultTypedConfigurationManager.java",
"identifier": "DefaultTypedConfigurationManager",
"interfaces": "implements TypedConfigurationManager",
"methods": [
{
"class_method_signature": "DefaultType... | {
"body": "@Override\n public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) {\n return new DefaultTypedProperty<T>(getProperty(key), valueParser);\n }",
"class_method_signature": "DefaultTypedConfigurationManager.getProperty(String key, ValueParser<T> valueParser)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_38 | {
"fields": [
{
"declarator": "managerId = \"soa\"",
"modifier": "static final",
"original_string": "static final String managerId = \"soa\";",
"type": "String",
"var_name": "managerId"
},
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.clas... | {
"body": "@Test\n public void updateServerList_AddNewRoute_Test() {\n int repeat = 2;\n int serverCount = 10;\n final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName();\n\n List<Server> servers = new ArrayList<>();\n for (int i = 0; i < serverCount; i++) {\... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class)",
"modifier": "private static",
"original_string": "private static Logger _logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class);",
"type": "Logger",
"var_name": "_logger"
... | {
"body": "@Override\n public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) {\n if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains()))\n return null;\n\n HashMap<String, LoadBalancer... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_39 | {
"fields": [],
"file": "caravan-util/src/test/java/com/ctrip/soa/caravan/util/serializer/ssjson/SSJsonSerializerTest.java",
"identifier": "SSJsonSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void specificValueTest() {\n String specificJson = \"{\\\"value\\\": \\\"abcd\\1nefg\\\"}\";\n TestEntity testEntity = SSJsonSerializer.DEFAULT.deserialize(new ByteArrayInputStream(specificJson.getBytes()), TestEntity.class);\n assertNotNull(testEntity.getValue());\n ... | {
"fields": [
{
"declarator": "DEFAULT = new SSJsonSerializer()",
"modifier": "public static final",
"original_string": "public static final SSJsonSerializer DEFAULT = new SSJsonSerializer();",
"type": "SSJsonSerializer",
"var_name": "DEFAULT"
},
{
"declarator": "_mappe... | {
"body": "@Override\n public <T> T deserialize(InputStream is, Class<T> clazz) {\n try {\n return _mapper.readValue(is, clazz);\n } catch (RuntimeException | Error ex) {\n throw ex;\n } catch (Exception ex) {\n throw new SerializationException(ex);\n }\... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_7 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/typed/DefaultTypedConfigurationManagerTest.java",
"identifier": "DefaultTypedConfigurationManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMapAbnormal() {\n MyConfigurationManager myManager = new MyConfigurationManager();\n DefaultTypedProperty<Map<String, String>> p = (DefaultTypedProperty<Map<String, String>>) myManager.getProperty(\"map\", \"mKey\", \"1112,,,2345,,12341,,, \");\n assertNull(... | {
"fields": [],
"file": "caravan-configuration/src/main/java/com/ctrip/soa/caravan/configuration/typed/DefaultTypedConfigurationManager.java",
"identifier": "DefaultTypedConfigurationManager",
"interfaces": "implements TypedConfigurationManager",
"methods": [
{
"class_method_signature": "DefaultType... | {
"body": "@Override\n public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) {\n return new DefaultTypedProperty<T>(getProperty(key), valueParser);\n }",
"class_method_signature": "DefaultTypedConfigurationManager.getProperty(String key, ValueParser<T> valueParser)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_15 | {
"fields": [],
"file": "caravan-common/src/test/java/com/ctrip/soa/caravan/common/value/DefaultValuesTest.java",
"identifier": "DefaultValuesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void isDefaultTest() {\n Assert.assertTrue(DefaultValues.isDefault(0));\n Assert.assertTrue(DefaultValues.isDefault(0.0));\n Assert.assertTrue(DefaultValues.isDefault(null));\n\n Assert.assertFalse(DefaultValues.isDefault(0.1));\n Assert.assertFalse(Defa... | {
"fields": [],
"file": "caravan-common/src/main/java/com/ctrip/soa/caravan/common/value/DefaultValues.java",
"identifier": "DefaultValues",
"interfaces": "",
"methods": [
{
"class_method_signature": "DefaultValues.DefaultValues()",
"constructor": true,
"full_signature": "private Defaul... | {
"body": "public static boolean isDefault(Object value) {\n if (value == null)\n return true;\n\n if (value instanceof Number && ((Number)value).doubleValue() == 0.0)\n return true;\n\n return false;\n }",
"class_method_signature": "DefaultValues.isDefault(Object value... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_23 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/ServerTest.java",
"identifier": "ServerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serverEquals_ServerId_Equals_Test() {\n Server server1 = Server.newBuilder().setServerId(\"abc\").build();\n Server server2 = Server.newBuilder().setServerId(\"abc\").build();\n Assert.assertEquals(server1, server2);\n Assert.assertEquals(server2, server1)... | {
"fields": [
{
"declarator": "serverId",
"modifier": "private",
"original_string": "private String serverId;",
"type": "String",
"var_name": "serverId"
},
{
"declarator": "isAlive = true",
"modifier": "private",
"original_string": "private boolean isAlive =... | {
"body": "public static Builder newBuilder() {\n return new Builder();\n }",
"class_method_signature": "Server.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_35 | {
"fields": [
{
"declarator": "managerId = \"soa\"",
"modifier": "static final",
"original_string": "static final String managerId = \"soa\";",
"type": "String",
"var_name": "managerId"
},
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.clas... | {
"body": "@Test\n public void updateServerList_NotPingMinAvailableServerCount_Test() {\n int serverCount = 10;\n final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName();\n final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId);\n\... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class)",
"modifier": "private static",
"original_string": "private static Logger _logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class);",
"type": "Logger",
"var_name": "_logger"
... | {
"body": "@Override\n public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) {\n if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains()))\n return null;\n\n HashMap<String, LoadBalancer... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_19 | {
"fields": [],
"file": "caravan-web/src/test/java/com/ctrip/soa/caravan/web/configuration/source/servletcontext/ServletContextConfigurationSourceTest.java",
"identifier": "ServletContextConfigurationSourceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConfiguration() {\n ServletContextConfigurationSource sccs = new ServletContextConfigurationSource(1, new MyServletContext());\n assertTrue(!Strings.isNullOrEmpty(sccs.configuration().getPropertyValue(\"env\")));\n }",
"class_method_signature": "ServletContextC... | {
"fields": [
{
"declarator": "_configuration",
"modifier": "private",
"original_string": "private ServletContextConfiguration _configuration;",
"type": "ServletContextConfiguration",
"var_name": "_configuration"
}
],
"file": "caravan-web/src/main/java/com/ctrip/soa/caravan/w... | {
"body": "@Override\n public Configuration configuration() {\n return _configuration;\n }",
"class_method_signature": "ServletContextConfigurationSource.configuration()",
"constructor": false,
"full_signature": "@Override public Configuration configuration()",
"identifier": "configuration",
"i... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_12 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/DefaultPropertyTest.java",
"identifier": "DefaultPropertyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() {\n MyConfigurationManager manager = new MyConfigurationManager();\n MyProperty mp = (MyProperty) manager.getProperty(\"\");\n System.out.println(mp.value());\n TypedProperty<Boolean> dbp = (DefaultTypedProperty<Boolean>) manager.getProperty(\"bool\... | {
"fields": [
{
"declarator": "_manager",
"modifier": "private",
"original_string": "private ConfigurationManager _manager;",
"type": "ConfigurationManager",
"var_name": "_manager"
},
{
"declarator": "_key",
"modifier": "private",
"original_string": "private... | {
"body": "@Override\n public String value() {\n return manager().getPropertyValue(key());\n }",
"class_method_signature": "DefaultProperty.value()",
"constructor": false,
"full_signature": "@Override public String value()",
"identifier": "value",
"invocations": [
"getPropertyValue",
"m... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_0 | {
"fields": [],
"file": "caravan-protobuf/src/test/java/com/ctrip/soa/caravan/protobuf/v2/customization/map/DynamicClassFactoryTest.java",
"identifier": "DynamicClassFactoryTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCreateClass() throws Exception {\n Class<?> c = DynamicClassFactory.INSTANCE.fetchOrCreatePairClass(new ClassPair(String.class, Date.class));\n KVPair pair = (KVPair) c.newInstance();\n\n assertEquals(1, c.getInterfaces().length);\n assertEquals(KVPair.class, c.getInter... | {
"fields": [
{
"declarator": "OBJECT_TYPE = \"Ljava/lang/Object;\"",
"modifier": "private final static",
"original_string": "private final static String OBJECT_TYPE = \"Ljava/lang/Object;\";",
"type": "String",
"var_name": "OBJECT_TYPE"
},
{
"declarator": "INSTANCE = n... | {
"body": "private Class<?> createClass(ClassPair classPair) {\n String className = generateClassName(classPair);\n String classStr = className.replaceAll(\"\\\\.\", \"/\");\n\n String keyClassType = Type.getDescriptor(classPair.keyClass);\n String valueClassType = Type.getDescriptor(classPair.valueClass)... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_28 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/ServerTest.java",
"identifier": "ServerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void ServerEquals_Metadata_KeyNotEquals_Test() {\n HashMap<String, String> server1Metadata = new HashMap<>();\n server1Metadata.put(\"Hello \", \"World\");\n server1Metadata.put(\"City\", \"Shanghai\");\n Server server1 = Server.newBuilder().setServerId(\"abc\"... | {
"fields": [
{
"declarator": "serverId",
"modifier": "private",
"original_string": "private String serverId;",
"type": "String",
"var_name": "serverId"
},
{
"declarator": "isAlive = true",
"modifier": "private",
"original_string": "private boolean isAlive =... | {
"body": "public static Builder newBuilder() {\n return new Builder();\n }",
"class_method_signature": "Server.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_32 | {
"fields": [
{
"declarator": "managerId = \"soa\"",
"modifier": "static final",
"original_string": "static final String managerId = \"soa\";",
"type": "String",
"var_name": "managerId"
},
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.clas... | {
"body": "@Test\n public void updateServerList_RetainStatus_Test() {\n int serverCount = 10;\n final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName();\n final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId);\n\n final Lis... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class)",
"modifier": "private static",
"original_string": "private static Logger _logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class);",
"type": "Logger",
"var_name": "_logger"
... | {
"body": "@Override\n public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) {\n if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains()))\n return null;\n\n HashMap<String, LoadBalancer... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_24 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/ServerTest.java",
"identifier": "ServerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serverEquals_IsAlive_Equals_Test() {\n Server server1 = Server.newBuilder().setServerId(\"abc\").setIsAlive(true).build();\n Server server2 = Server.newBuilder().setServerId(\"abc\").setIsAlive(false).build();\n Assert.assertEquals(server1, server2);\n Ass... | {
"fields": [
{
"declarator": "serverId",
"modifier": "private",
"original_string": "private String serverId;",
"type": "String",
"var_name": "serverId"
},
{
"declarator": "isAlive = true",
"modifier": "private",
"original_string": "private boolean isAlive =... | {
"body": "public static Builder newBuilder() {\n return new Builder();\n }",
"class_method_signature": "Server.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_25 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/ServerTest.java",
"identifier": "ServerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void serverEquals_Metadata_Equals_Test() {\n HashMap<String, String> server1Metadata = new HashMap<>();\n server1Metadata.put(\"Hello\", \"World\");\n server1Metadata.put(\"City\", \"Shanghai\");\n Server server1 = Server.newBuilder().setServerId(\"abc\").setMe... | {
"fields": [
{
"declarator": "serverId",
"modifier": "private",
"original_string": "private String serverId;",
"type": "String",
"var_name": "serverId"
},
{
"declarator": "isAlive = true",
"modifier": "private",
"original_string": "private boolean isAlive =... | {
"body": "public static Builder newBuilder() {\n return new Builder();\n }",
"class_method_signature": "Server.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_33 | {
"fields": [
{
"declarator": "managerId = \"soa\"",
"modifier": "static final",
"original_string": "static final String managerId = \"soa\";",
"type": "String",
"var_name": "managerId"
},
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.clas... | {
"body": "@Test\n public void updateServerList_UnavailableServer_Test() {\n final int serverCount = 10;\n final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName();\n final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId);\n\n ... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class)",
"modifier": "private static",
"original_string": "private static Logger _logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class);",
"type": "Logger",
"var_name": "_logger"
... | {
"body": "@Override\n public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) {\n if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains()))\n return null;\n\n HashMap<String, LoadBalancer... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_29 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/ServerTest.java",
"identifier": "ServerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void ServerEquals_Metadata_ValueNotEquals_Test() {\n HashMap<String, String> server1Metadata = new HashMap<>();\n server1Metadata.put(\"Hello\", \"World \");\n server1Metadata.put(\"City\", \"Shanghai\");\n Server server1 = Server.newBuilder().setServerId(\"abc... | {
"fields": [
{
"declarator": "serverId",
"modifier": "private",
"original_string": "private String serverId;",
"type": "String",
"var_name": "serverId"
},
{
"declarator": "isAlive = true",
"modifier": "private",
"original_string": "private boolean isAlive =... | {
"body": "public static Builder newBuilder() {\n return new Builder();\n }",
"class_method_signature": "Server.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_1 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/DefaultConfigurationManagerTest.java",
"identifier": "DefaultConfigurationManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInit() {\n MyConfigurationSource mcs1 = new MyConfigurationSource(1);\n MyConfigurationSource mcs2 = new MyConfigurationSource(2);\n MyConfigurationSource mcs3 = new MyConfigurationSource(3);\n MyConfigurationSource mcs4 = new MyConfigurationSource(4);... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultConfigurationManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(DefaultConfigurationManager.class);",
"type": "Logger",
"var_nam... | {
"body": "protected void init(List<ConfigurationSource> sources) {\n if (CollectionValues.isNullOrEmpty(sources)) {\n _sources = EMPTY_CONFIGURATION_SOURCE_LIST;\n _logger.warn(\"sources is null or empty\");\n return;\n }\n\n _sources = new ArrayList<Configuratio... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_13 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/cached/DefaultCachedPropertyTest.java",
"identifier": "DefaultCachedPropertyTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testValue() {\n MyProperty mp = new MyProperty(\"k1\", \"v1\");\n DefaultCachedProperty dcp = new DefaultCachedProperty(mp);\n assertEquals(dcp.value(), \"v1\");\n }",
"class_method_signature": "DefaultCachedPropertyTest.testValue()",
"constructor": false,... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultCachedProperty.class)",
"modifier": "private static final",
"original_string": "private static final Logger _logger = LoggerFactory.getLogger(DefaultCachedProperty.class);",
"type": "Logger",
"var_name": "_logger... | {
"body": "@Override\n public String value() {\n return _value;\n }",
"class_method_signature": "DefaultCachedProperty.value()",
"constructor": false,
"full_signature": "@Override public String value()",
"identifier": "value",
"invocations": [],
"modifiers": "@Override public",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_2 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/typed/DefaultTypedConfigurationManagerTest.java",
"identifier": "DefaultTypedConfigurationManagerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDefault() {\n MyConfigurationManager myManager = new MyConfigurationManager();\n DefaultTypedConfigurationManager manager = new DefaultTypedConfigurationManager(myManager);\n\n System.out.println(manager.getProperty(\"\").value());\n System.out.println... | {
"fields": [],
"file": "caravan-configuration/src/main/java/com/ctrip/soa/caravan/configuration/typed/DefaultTypedConfigurationManager.java",
"identifier": "DefaultTypedConfigurationManager",
"interfaces": "implements TypedConfigurationManager",
"methods": [
{
"class_method_signature": "DefaultType... | {
"body": "@Override\n public <T> TypedProperty<T> getProperty(String key, ValueParser<T> valueParser) {\n return new DefaultTypedProperty<T>(getProperty(key), valueParser);\n }",
"class_method_signature": "DefaultTypedConfigurationManager.getProperty(String key, ValueParser<T> valueParser)",
"constr... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_10 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/source/environmentvariable/EnvironmentVariableConfigurationSourceTest.java",
"identifier": "EnvironmentVariableConfigurationSourceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEnvironmentVariableConfigurationSource() {\n EnvironmentVariableConfigurationSource cs = new EnvironmentVariableConfigurationSource(0);\n assertEquals(cs.priority(), 0);\n }",
"class_method_signature": "EnvironmentVariableConfigurationSourceTest.testEnvironment... | {
"fields": [
{
"declarator": "_configuration = new EnvironmentVariableConfiguration()",
"modifier": "private",
"original_string": "private EnvironmentVariableConfiguration _configuration = new EnvironmentVariableConfiguration();",
"type": "EnvironmentVariableConfiguration",
"var_nam... | {
"body": "public EnvironmentVariableConfigurationSource(final int priority) {\n super(priority, \"EnvironmentVariable\");\n }",
"class_method_signature": "EnvironmentVariableConfigurationSource.EnvironmentVariableConfigurationSource(final int priority)",
"constructor": true,
"full_signature": "public... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_26 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/ServerTest.java",
"identifier": "ServerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void ServerEquals_Metadata_NullEqualEmpty_Test() {\n Server server1 = Server.newBuilder().setServerId(\"abc\").setMetadata(null).build();\n Server server2 = Server.newBuilder().setServerId(\"abc\").setMetadata(new HashMap<String, String>()).build();\n Assert.assertEqu... | {
"fields": [
{
"declarator": "serverId",
"modifier": "private",
"original_string": "private String serverId;",
"type": "String",
"var_name": "serverId"
},
{
"declarator": "isAlive = true",
"modifier": "private",
"original_string": "private boolean isAlive =... | {
"body": "public static Builder newBuilder() {\n return new Builder();\n }",
"class_method_signature": "Server.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_30 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/rule/RoundRobinRuleTest.java",
"identifier": "RoundRobinRuleTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void roundRobinRuleTest() {\n\n final int serverCount = 10;\n final int repeatTimes = 5;\n final int threadCount = 10;\n final String factoryId = \"soa\";\n final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName();\n final Loa... | {
"fields": [
{
"declarator": "loadBalancerRoute",
"modifier": "protected volatile",
"original_string": "protected volatile LoadBalancerRoute loadBalancerRoute;",
"type": "LoadBalancerRoute",
"var_name": "loadBalancerRoute"
},
{
"declarator": "serverGroups",
"modi... | {
"body": "public RoundRobinRule() {\n serverContexts = new ConcurrentHashMap<>();\n roundRobinAlgorithm = new DefaultRoundRobinAlgorithm<>();\n }",
"class_method_signature": "RoundRobinRule.RoundRobinRule()",
"constructor": true,
"full_signature": "public RoundRobinRule()",
"identifier": "R... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_31 | {
"fields": [
{
"declarator": "managerId = \"soa\"",
"modifier": "static final",
"original_string": "static final String managerId = \"soa\";",
"type": "String",
"var_name": "managerId"
},
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.clas... | {
"body": "@Test\n public void updateServerListTest() {\n final int serverCount = 10;\n final String lbId = Thread.currentThread().getStackTrace()[1].getMethodName();\n final LoadBalancerRequestConfig loadBalancerRequestConfig = new LoadBalancerRequestConfig(lbId);\n\n List<Server> serv... | {
"fields": [
{
"declarator": "_logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class)",
"modifier": "private static",
"original_string": "private static Logger _logger = LoggerFactory.getLogger(DefaultServerSourceFilter.class);",
"type": "Logger",
"var_name": "_logger"
... | {
"body": "@Override\n public LoadBalancerRoute getLoadBalancerRoute(LoadBalancerRequestConfig loadBalancerRequestConfig) {\n if (loadBalancerRequestConfig == null || CollectionValues.isNullOrEmpty(loadBalancerRequestConfig.getRouteChains()))\n return null;\n\n HashMap<String, LoadBalancer... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_27 | {
"fields": [],
"file": "caravan-ribbon/src/test/java/com/ctrip/soa/caravan/ribbon/ServerTest.java",
"identifier": "ServerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void ServerEquals_Metadata_CountNotEquals_Test() {\n HashMap<String, String> server1Metadata = new HashMap<>();\n server1Metadata.put(\"City\", \"Shanghai\");\n Server server1 = Server.newBuilder().setServerId(\"abc\").setMetadata(server1Metadata).build();\n\n ... | {
"fields": [
{
"declarator": "serverId",
"modifier": "private",
"original_string": "private String serverId;",
"type": "String",
"var_name": "serverId"
},
{
"declarator": "isAlive = true",
"modifier": "private",
"original_string": "private boolean isAlive =... | {
"body": "public static Builder newBuilder() {\n return new Builder();\n }",
"class_method_signature": "Server.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
"parameters"... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
107386062_11 | {
"fields": [],
"file": "caravan-configuration/src/test/java/com/ctrip/soa/caravan/configuration/source/environmentvariable/EnvironmentVariableConfigurationSourceTest.java",
"identifier": "EnvironmentVariableConfigurationSourceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConfiguration() {\n EnvironmentVariableConfigurationSource cs = new EnvironmentVariableConfigurationSource(0);\n assertNotNull(cs.configuration());\n assertTrue(!Strings.isNullOrEmpty(cs.configuration().getPropertyValue(\"sun.management.compiler\")));\n }"... | {
"fields": [
{
"declarator": "_configuration = new EnvironmentVariableConfiguration()",
"modifier": "private",
"original_string": "private EnvironmentVariableConfiguration _configuration = new EnvironmentVariableConfiguration();",
"type": "EnvironmentVariableConfiguration",
"var_nam... | {
"body": "@Override\n public Configuration configuration() {\n return _configuration;\n }",
"class_method_signature": "EnvironmentVariableConfigurationSource.configuration()",
"constructor": false,
"full_signature": "@Override public Configuration configuration()",
"identifier": "configuration",... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 107386062,
"size": 290,
"stargazer_count": 32,
"stars": null,
"updates": null,
"url": "https://github.com/ctripcorp/caravan"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.