id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
8143599_4
{ "fields": [ { "declarator": "queue", "modifier": "private", "original_string": "private Queue queue;", "type": "Queue", "var_name": "queue" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\t...
{ "body": "@Test\n\tpublic void testIsEmpty() {\n\t\tassertTrue(queue.isEmpty());\n\t\tqueue.enqueue(new Object());\n\t\tassertFalse(queue.isEmpty());\n\t\tqueue.dequeue();\n\t\tassertTrue(queue.isEmpty());\n\t}", "class_method_signature": "QueueTest.testIsEmpty()", "constructor": false, "full_signature": "@Tes...
{ "fields": [ { "declarator": "maxQueueSize = 0", "modifier": "private", "original_string": "private int maxQueueSize = 0;", "type": "int", "var_name": "maxQueueSize" }, { "declarator": "queueData = new LinkedList<Object>()", "modifier": "private", "original...
{ "body": "public boolean isEmpty() {\n\t\tsynchronized (mutex) {\n\t\t\treturn queueData.isEmpty();\n\t\t}\n\t}", "class_method_signature": "Queue.isEmpty()", "constructor": false, "full_signature": "public boolean isEmpty()", "identifier": "isEmpty", "invocations": [ "isEmpty" ], "modifiers": "pub...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_10
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendShort0() {\n\t\tbuffer.appendShort(t_short);\n\t\tassertBufferMatches((byte) 0x02, (byte) 0x9a);\n\t}", "class_method_signature": "ByteBufferTest.testAppendShort0()", "constructor": false, "full_signature": "@Test public void testAppendShort0()", "identifier": "testAp...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendShort(short data) {\n\t\tbyte[] shortBuf = new byte[SZ_SHORT];\n\t\tshortBuf[1] = (byte) (data & 0xff);\n\t\tshortBuf[0] = (byte) ((data >>> 8) & 0xff);\n\t\tappendBytes0(shortBuf, SZ_SHORT);\n\t}", "class_method_signature": "ByteBuffer.appendShort(short data)", "constructor": false, ...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_47
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testRemoveCStringRemovesWithASCIIEncoding() throws Exception {\n\t\tbuffer = bufferOf(A, UNDERLINE, NULL);\n\t\tassertEquals(\"A_\", buffer.removeCString(Data.ENC_ASCII));\n\t}", "class_method_signature": "ByteBufferTest.testRemoveCStringRemovesWithASCIIEncoding()", "constructor": ...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public String removeCString() throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException {\n\t\ttry {\n\t\t\treturn removeCString(Data.ENC_ASCII);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t// this can't happen as we use ASCII encoding\n\t\t\t// whatever is in the buffer it get...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_84
{ "fields": [ { "declarator": "CLAZZ = ByteData.class", "modifier": "private static", "original_string": "private static Class<?> CLAZZ = ByteData.class;", "type": "Class<?>", "var_name": "CLAZZ" }, { "declarator": "thrown = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n\tpublic void testCheckRangeBelow() throws Exception {\n\t\tthrown.expect(integerOutOfRange(5, 10, 1));\n\t\tcheckRange(5, 1, 10);\n\t}", "class_method_signature": "ByteDataTest.testCheckRangeBelow()", "constructor": false, "full_signature": "@Test public void testCheckRangeBelow()", "identi...
{ "fields": [ { "declarator": "SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\"", "modifier": "private static final", "original_string": "private static final String SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\";", "type": "String", "var_name": "SMPP_TIME_DATE_FORMAT" }, { "declarat...
{ "body": "protected static void checkRange(int min, int val, int max) throws IntegerOutOfRangeException {\n\t\tif ((val < min) || (val > max)) {\n\t\t\tthrow new IntegerOutOfRangeException(min, max, val);\n\t\t}\n\t}", "class_method_signature": "ByteData.checkRange(int min, int val, int max)", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_92
{ "fields": [], "file": "core/src/test/java/org/smpp/SmppObjectTest.java", "identifier": "SmppObjectTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testSetDebug() {\n\t\tDebug debug = mock(Debug.class);\n\t\tSmppObject.setDebug(debug);\n\t\tassertEquals(debug, SmppObject.getDebug());\n\t}", "class_method_signature": "SmppObjectTest.testSetDebug()", "constructor": false, "full_signature": "@Test public void testSetDebug()", ...
{ "fields": [ { "declarator": "debug", "modifier": "static protected", "original_string": "static protected Debug debug;", "type": "Debug", "var_name": "debug" }, { "declarator": "event", "modifier": "static protected", "original_string": "static protected E...
{ "body": "static public void setDebug(Debug dbg) {\n\t\tdebug = dbg;\n\t}", "class_method_signature": "SmppObject.setDebug(Debug dbg)", "constructor": false, "full_signature": "static public void setDebug(Debug dbg)", "identifier": "setDebug", "invocations": [], "modifiers": "static public", "parameter...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_8
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendByte0() {\n\t\tbuffer.appendByte(t_bite);\n\t\tassertBufferMatches(t_bite);\n\t}", "class_method_signature": "ByteBufferTest.testAppendByte0()", "constructor": false, "full_signature": "@Test public void testAppendByte0()", "identifier": "testAppendByte0", "invocati...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendByte(byte data) {\n\t\tbyte[] byteBuf = new byte[SZ_BYTE];\n\t\tbyteBuf[0] = data;\n\t\tappendBytes0(byteBuf, SZ_BYTE);\n\t}", "class_method_signature": "ByteBuffer.appendByte(byte data)", "constructor": false, "full_signature": "public void appendByte(byte data)", "identifier": "...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_30
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testRemoveByteFromEmptyThrowsException() throws Exception {\n\t\tthrown.expect(NotEnoughDataInByteBufferException.class);\n\t\tthrown.expect(notEnoughData(1, 0));\n\n\t\tbuffer = new ByteBuffer(new byte[] { });\n\t\tbuffer.removeByte();\n\t}", "class_method_signature": "ByteBufferTes...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public byte removeByte() throws NotEnoughDataInByteBufferException {\n\t\tbyte result = 0;\n\t\tbyte[] resBuff = removeBytes(SZ_BYTE).getBuffer();\n\t\tresult = resBuff[0];\n\t\treturn result;\n\t}", "class_method_signature": "ByteBuffer.removeByte()", "constructor": false, "full_signature": "public ...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_88
{ "fields": [ { "declarator": "CLAZZ = ByteData.class", "modifier": "private static", "original_string": "private static Class<?> CLAZZ = ByteData.class;", "type": "Class<?>", "var_name": "CLAZZ" }, { "declarator": "thrown = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n\tpublic void testEncodeUnsignedShort() throws Exception {\n\t\tassertEquals((byte) 0x00, encodeUnsigned((short) 0));\n\t\tassertEquals((byte) 0xff, encodeUnsigned((short) 255));\n\t}", "class_method_signature": "ByteDataTest.testEncodeUnsignedShort()", "constructor": false, "full_signature": ...
{ "fields": [ { "declarator": "SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\"", "modifier": "private static final", "original_string": "private static final String SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\";", "type": "String", "var_name": "SMPP_TIME_DATE_FORMAT" }, { "declarat...
{ "body": "protected static byte encodeUnsigned(short positive) {\n\t\tif (positive < 128) {\n\t\t\treturn (byte) positive;\n\t\t} else {\n\t\t\treturn (byte) (- (256 - positive));\n\t\t}\n\t}", "class_method_signature": "ByteData.encodeUnsigned(short positive)", "constructor": false, "full_signature": "protect...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_67
{ "fields": [ { "declarator": "OBJECT = new Object() {\n\t\t@Override public String toString() { return \"OBJECT\"; }\n\t}", "modifier": "private static final", "original_string": "private static final Object OBJECT = new Object() {\n\t\t@Override public String toString() { return \"OBJECT\"; }\...
{ "body": "@Test\n\tpublic void testNestedEnter() {\n\t\tdebug.enter(OBJECT, NAME);\n\t\tdebug.enter(OBJECT, NAME);\n\t\tassertEquals(\"-> OBJECT NAME\" + newLine + \" -> OBJECT NAME\" + newLine, out.toString());\n\t}", "class_method_signature": "DefaultDebugTest.testNestedEnter()", "constructor": false, "full...
{ "fields": [ { "declarator": "indent = 0", "modifier": "private", "original_string": "private int indent = 0;", "type": "int", "var_name": "indent" }, { "declarator": "active = false", "modifier": "private", "original_string": "private boolean active = fals...
{ "body": "public void enter(int group, Object from, String name) {\n\t\tenter(from, name);\n\t}", "class_method_signature": "DefaultDebug.enter(int group, Object from, String name)", "constructor": false, "full_signature": "public void enter(int group, Object from, String name)", "identifier": "enter", "in...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_71
{ "fields": [ { "declarator": "TONS = new byte[] {\n\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07\n\t}", "modifier": "private static final", "original_string": "private static final byte[] TONS = new byte[] {\n\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07\n\t};", "type": "byte[]"...
{ "body": "@Test(expected = WrongLengthOfStringException.class)\n\tpublic void testConstructorStringIntSpecifiesAddressLength() throws Exception {\n\t\tnew Address(address(5), 5);\n\t}", "class_method_signature": "AddressTest.testConstructorStringIntSpecifiesAddressLength()", "constructor": false, "full_signatu...
{ "fields": [ { "declarator": "ton = Data.DFLT_GSM_TON", "modifier": "private", "original_string": "private byte ton = Data.DFLT_GSM_TON;", "type": "byte", "var_name": "ton" }, { "declarator": "npi = Data.DFLT_GSM_NPI", "modifier": "private", "original_strin...
{ "body": "public Address() {\n\t\tthis(Data.getDefaultTon(), Data.getDefaultNpi(), defaultMaxAddressLength);\n\t}", "class_method_signature": "Address.Address()", "constructor": true, "full_signature": "public Address()", "identifier": "Address", "invocations": [], "modifiers": "public", "parameters":...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_26
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendBuferAppendsAll() {\n\t\tbuffer.appendBuffer(bufferOf(A, B, C));\n\t\tassertBufferMatches(A, B, C);\n\t}", "class_method_signature": "ByteBufferTest.testAppendBuferAppendsAll()", "constructor": false, "full_signature": "@Test public void testAppendBuferAppendsAll()", ...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendBuffer(ByteBuffer buf) {\n\t\tif (buf != null) {\n\t\t\ttry {\n\t\t\t\tappendBytes(buf, buf.length());\n\t\t\t} catch (NotEnoughDataInByteBufferException e) {\n\t\t\t\t// can't happen as appendBytes only complains\n\t\t\t\t// when count>buf.length\n\t\t\t}\n\t\t}\n\t}", "class_method_si...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_27
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testReadBytesWithZeroCountReturnsNull() throws Exception {\n\t\tassertNull(buffer.readBytes(0));\n\t}", "class_method_signature": "ByteBufferTest.testReadBytesWithZeroCountReturnsNull()", "constructor": false, "full_signature": "@Test public void testReadBytesWithZeroCountReturns...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public ByteBuffer readBytes(int count) throws NotEnoughDataInByteBufferException {\n\t\tint len = length();\n\t\tByteBuffer result = null;\n\t\tif (count > 0) {\n\t\t\tif (len >= count) {\n\t\t\t\tbyte[] resBuf = new byte[count];\n\t\t\t\tSystem.arraycopy(buffer, 0, resBuf, 0, count);\n\t\t\t\tresult = new...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_70
{ "fields": [ { "declarator": "TONS = new byte[] {\n\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07\n\t}", "modifier": "private static final", "original_string": "private static final byte[] TONS = new byte[] {\n\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07\n\t};", "type": "byte[]"...
{ "body": "@Test(expected = WrongLengthOfStringException.class)\n\tpublic void testConstructorStringUsesDefaultMaxLength() throws Exception {\n\t\tnew Address(address(21));\n\t}", "class_method_signature": "AddressTest.testConstructorStringUsesDefaultMaxLength()", "constructor": false, "full_signature": "@Test(...
{ "fields": [ { "declarator": "ton = Data.DFLT_GSM_TON", "modifier": "private", "original_string": "private byte ton = Data.DFLT_GSM_TON;", "type": "byte", "var_name": "ton" }, { "declarator": "npi = Data.DFLT_GSM_NPI", "modifier": "private", "original_strin...
{ "body": "public Address() {\n\t\tthis(Data.getDefaultTon(), Data.getDefaultNpi(), defaultMaxAddressLength);\n\t}", "class_method_signature": "Address.Address()", "constructor": true, "full_signature": "public Address()", "identifier": "Address", "invocations": [], "modifiers": "public", "parameters":...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_89
{ "fields": [ { "declarator": "CLAZZ = ByteData.class", "modifier": "private static", "original_string": "private static Class<?> CLAZZ = ByteData.class;", "type": "Class<?>", "var_name": "CLAZZ" }, { "declarator": "thrown = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n\tpublic void testEncodeUnsignedInt() throws Exception {\n\t\tassertEquals((short) 0, encodeUnsigned((int) 0));\n\t\tassertEquals((short) 32768, encodeUnsigned((int) 32768));\n\t}", "class_method_signature": "ByteDataTest.testEncodeUnsignedInt()", "constructor": false, "full_signature": "@Test...
{ "fields": [ { "declarator": "SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\"", "modifier": "private static final", "original_string": "private static final String SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\";", "type": "String", "var_name": "SMPP_TIME_DATE_FORMAT" }, { "declarat...
{ "body": "protected static byte encodeUnsigned(short positive) {\n\t\tif (positive < 128) {\n\t\t\treturn (byte) positive;\n\t\t} else {\n\t\t\treturn (byte) (- (256 - positive));\n\t\t}\n\t}", "class_method_signature": "ByteData.encodeUnsigned(short positive)", "constructor": false, "full_signature": "protect...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_66
{ "fields": [ { "declarator": "OBJECT = new Object() {\n\t\t@Override public String toString() { return \"OBJECT\"; }\n\t}", "modifier": "private static final", "original_string": "private static final Object OBJECT = new Object() {\n\t\t@Override public String toString() { return \"OBJECT\"; }\...
{ "body": "@Test\n\tpublic void testWrite() {\n\t\tdebug.write(0, \"HELLO\");\n\t\tassertEquals(\" HELLO\" + newLine, out.toString());\n\t}", "class_method_signature": "DefaultDebugTest.testWrite()", "constructor": false, "full_signature": "@Test public void testWrite()", "identifier": "testWrite", "invocat...
{ "fields": [ { "declarator": "indent = 0", "modifier": "private", "original_string": "private int indent = 0;", "type": "int", "var_name": "indent" }, { "declarator": "active = false", "modifier": "private", "original_string": "private boolean active = fals...
{ "body": "public void write(int group, String msg) {\n\t\twrite(msg);\n\t}", "class_method_signature": "DefaultDebug.write(int group, String msg)", "constructor": false, "full_signature": "public void write(int group, String msg)", "identifier": "write", "invocations": [ "write" ], "modifiers": "pu...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_31
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testRemoveByteRemovesFirstByte() throws Exception {\n\t\tbuffer = bufferOf(A, B, C);\n\t\tbyte bite = buffer.removeByte();\n\t\tassertEquals(A, bite);\n\t}", "class_method_signature": "ByteBufferTest.testRemoveByteRemovesFirstByte()", "constructor": false, "full_signature": "@Tes...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public byte removeByte() throws NotEnoughDataInByteBufferException {\n\t\tbyte result = 0;\n\t\tbyte[] resBuff = removeBytes(SZ_BYTE).getBuffer();\n\t\tresult = resBuff[0];\n\t\treturn result;\n\t}", "class_method_signature": "ByteBuffer.removeByte()", "constructor": false, "full_signature": "public ...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_9
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendByte1() {\n\t\tbuffer = new ByteBuffer(new byte[] {});\n\t\tbuffer.appendByte(t_bite);\n\t\tassertBufferMatches(t_bite);\n\t}", "class_method_signature": "ByteBufferTest.testAppendByte1()", "constructor": false, "full_signature": "@Test public void testAppendByte1()", ...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendByte(byte data) {\n\t\tbyte[] byteBuf = new byte[SZ_BYTE];\n\t\tbyteBuf[0] = data;\n\t\tappendBytes0(byteBuf, SZ_BYTE);\n\t}", "class_method_signature": "ByteBuffer.appendByte(byte data)", "constructor": false, "full_signature": "public void appendByte(byte data)", "identifier": "...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_93
{ "fields": [], "file": "core/src/test/java/org/smpp/SmppObjectTest.java", "identifier": "SmppObjectTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testSetEvent() {\n\t\tEvent event = mock(Event.class);\n\t\tSmppObject.setEvent(event);\n\t\tassertEquals(event, SmppObject.getEvent());\n\t}", "class_method_signature": "SmppObjectTest.testSetEvent()", "constructor": false, "full_signature": "@Test public void testSetEvent()", ...
{ "fields": [ { "declarator": "debug", "modifier": "static protected", "original_string": "static protected Debug debug;", "type": "Debug", "var_name": "debug" }, { "declarator": "event", "modifier": "static protected", "original_string": "static protected E...
{ "body": "static public void setEvent(Event evt) {\n\t\tevent = evt;\n\t}", "class_method_signature": "SmppObject.setEvent(Event evt)", "constructor": false, "full_signature": "static public void setEvent(Event evt)", "identifier": "setEvent", "invocations": [], "modifiers": "static public", "parameter...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_85
{ "fields": [ { "declarator": "CLAZZ = ByteData.class", "modifier": "private static", "original_string": "private static Class<?> CLAZZ = ByteData.class;", "type": "Class<?>", "var_name": "CLAZZ" }, { "declarator": "thrown = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n\tpublic void testCheckRangeAbove() throws Exception {\n\t\tthrown.expect(integerOutOfRange(5, 10, 11));\n\t\tcheckRange(5, 11, 10);\n\t}", "class_method_signature": "ByteDataTest.testCheckRangeAbove()", "constructor": false, "full_signature": "@Test public void testCheckRangeAbove()", "iden...
{ "fields": [ { "declarator": "SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\"", "modifier": "private static final", "original_string": "private static final String SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\";", "type": "String", "var_name": "SMPP_TIME_DATE_FORMAT" }, { "declarat...
{ "body": "protected static void checkRange(int min, int val, int max) throws IntegerOutOfRangeException {\n\t\tif ((val < min) || (val > max)) {\n\t\t\tthrow new IntegerOutOfRangeException(min, max, val);\n\t\t}\n\t}", "class_method_signature": "ByteData.checkRange(int min, int val, int max)", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_46
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testRemoveCStringRemovesWithDefaultEncoding() throws Exception {\n\t\tbuffer = bufferOf(A, UNDERLINE, NULL);\n\t\tassertEquals(\"A_\", buffer.removeCString());\n\t}", "class_method_signature": "ByteBufferTest.testRemoveCStringRemovesWithDefaultEncoding()", "constructor": false, "...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public String removeCString() throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException {\n\t\ttry {\n\t\t\treturn removeCString(Data.ENC_ASCII);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t// this can't happen as we use ASCII encoding\n\t\t\t// whatever is in the buffer it get...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_11
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendInt0() {\n\t\tbuffer.appendInt(666);\n\t\tassertBufferMatches(NULL, NULL, (byte) 0x02, (byte) 0x9a);\n\t}", "class_method_signature": "ByteBufferTest.testAppendInt0()", "constructor": false, "full_signature": "@Test public void testAppendInt0()", "identifier": "testAp...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendInt(int data) {\n\t\tbyte[] intBuf = new byte[SZ_INT];\n\t\tintBuf[3] = (byte) (data & 0xff);\n\t\tintBuf[2] = (byte) ((data >>> 8) & 0xff);\n\t\tintBuf[1] = (byte) ((data >>> 16) & 0xff);\n\t\tintBuf[0] = (byte) ((data >>> 24) & 0xff);\n\t\tappendBytes0(intBuf, SZ_INT);\n\t}", "class_m...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_5
{ "fields": [ { "declarator": "queue", "modifier": "private", "original_string": "private Queue queue;", "type": "Queue", "var_name": "queue" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\t...
{ "body": "@Test\n\tpublic void testSize() {\n\t\tint size = 0;\n\t\tassertEquals(size, queue.size());\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tqueue.enqueue(size++);\n\t\t\tassertEquals(size, queue.size());\n\t\t}\n\t}", "class_method_signature": "QueueTest.testSize()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "maxQueueSize = 0", "modifier": "private", "original_string": "private int maxQueueSize = 0;", "type": "int", "var_name": "maxQueueSize" }, { "declarator": "queueData = new LinkedList<Object>()", "modifier": "private", "original...
{ "body": "public int size() {\n\t\tsynchronized (mutex) {\n\t\t\treturn queueData.size();\n\t\t}\n\t}", "class_method_signature": "Queue.size()", "constructor": false, "full_signature": "public int size()", "identifier": "size", "invocations": [ "size" ], "modifiers": "public", "parameters": "()"...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_50
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testRemoveStringWithInvalidEncodingThrowsException() throws Exception {\n\t\tthrown.expect(UnsupportedEncodingException.class);\n\n\t\tbuffer = bufferOf(A, B, C);\n\t\tbuffer.removeString(3, INVALID);\n\t}", "class_method_signature": "ByteBufferTest.testRemoveStringWithInvalidEncodin...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public String removeString(int size, String encoding)\n\t\tthrows NotEnoughDataInByteBufferException, UnsupportedEncodingException {\n\t\tint len = length();\n\t\tif (len < size) {\n\t\t\tthrow new NotEnoughDataInByteBufferException(len, size);\n\t\t}\n\t\tUnsupportedEncodingException encodingException = n...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_36
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testReadIntReadsFirstInt() throws Exception {\n\t\tbuffer = bufferOf((byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08);\n\t\tint i = buffer.readInt();\n\t\tassertEquals((1 << 24) + (2 << 16) + (3 << 8) + 4, i);\n\t}", "class_metho...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public int readInt() throws NotEnoughDataInByteBufferException {\n\t\tint result = 0;\n\t\tint len = length();\n\t\tif (len >= SZ_INT) {\n\t\t\tresult |= buffer[0] & 0xff;\n\t\t\tresult <<= 8;\n\t\t\tresult |= buffer[1] & 0xff;\n\t\t\tresult <<= 8;\n\t\t\tresult |= buffer[2] & 0xff;\n\t\t\tresult <<= 8;\n\...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_61
{ "fields": [ { "declarator": "out", "modifier": "private", "original_string": "private ByteArrayOutputStream out;", "type": "ByteArrayOutputStream", "var_name": "out" }, { "declarator": "event", "modifier": "private", "original_string": "private DefaultEven...
{ "body": "@Test\n\tpublic void testWriteException() {\n\t\ttry { throw new RuntimeException(); }\n\t\tcatch (Exception ex) {\n\t\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\t\t\tex.printStackTrace(new PrintStream(baos));\n\n\t\t\tString expected = \"Exception: \" + baos.toString() + \" END\" + new...
{ "fields": [ { "declarator": "active = false", "modifier": "private", "original_string": "private boolean active = false;", "type": "boolean", "var_name": "active" } ], "file": "core/src/main/java/org/smpp/debug/DefaultEvent.java", "identifier": "DefaultEvent", "interfac...
{ "body": "public void write(String msg) {\n\t\tif (active) {\n\t\t\tSystem.out.println(msg);\n\t\t}\n\t}", "class_method_signature": "DefaultEvent.write(String msg)", "constructor": false, "full_signature": "public void write(String msg)", "identifier": "write", "invocations": [ "println" ], "modif...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_77
{ "fields": [ { "declarator": "CLAZZ = ByteData.class", "modifier": "private static", "original_string": "private static Class<?> CLAZZ = ByteData.class;", "type": "Class<?>", "var_name": "CLAZZ" }, { "declarator": "thrown = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n\tpublic void testCheckStringEqualZero() throws Exception {\n\t\tcheckString(\"\", 0);\n\t}", "class_method_signature": "ByteDataTest.testCheckStringEqualZero()", "constructor": false, "full_signature": "@Test public void testCheckStringEqualZero()", "identifier": "testCheckStringEqualZero",...
{ "fields": [ { "declarator": "SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\"", "modifier": "private static final", "original_string": "private static final String SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\";", "type": "String", "var_name": "SMPP_TIME_DATE_FORMAT" }, { "declarat...
{ "body": "protected static void checkString(String string, int max) throws WrongLengthOfStringException {\n\t\tcheckString(string, 0, max);\n\t}", "class_method_signature": "ByteData.checkString(String string, int max)", "constructor": false, "full_signature": "protected static void checkString(String string, ...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_20
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendBytes() {\n\t\tbuffer.appendBytes(new byte[] { A, B, C });\n\t\tassertBufferMatches(A, B, C);\n\t}", "class_method_signature": "ByteBufferTest.testAppendBytes()", "constructor": false, "full_signature": "@Test public void testAppendBytes()", "identifier": "testAppendB...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendBytes(ByteBuffer bytes, int count) throws NotEnoughDataInByteBufferException {\n\t\tif (count > 0) {\n\t\t\tif (bytes == null) {\n\t\t\t\tthrow new NotEnoughDataInByteBufferException(0, count);\n\t\t\t}\n\t\t\tif (bytes.length() < count) {\n\t\t\t\tthrow new NotEnoughDataInByteBufferExcep...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_57
{ "fields": [ { "declarator": "unprocessed", "modifier": "private", "original_string": "private Unprocessed unprocessed;", "type": "Unprocessed", "var_name": "unprocessed" } ], "file": "core/src/test/java/org/smpp/util/UnprocessedTest.java", "identifier": "UnprocessedTest",...
{ "body": "@Test\n\tpublic void testReset() {\n\t\tunprocessed.getUnprocessed().setBuffer(new byte[] { 0x00 });\n\t\tunprocessed.setExpected(1);\n\t\tunprocessed.setHasUnprocessed(true);\n\t\tunprocessed.setLastTimeReceived(1);\n\n\t\tunprocessed.reset();\n\n\t\tassertNull(unprocessed.getUnprocessed().getBuffer());\n...
{ "fields": [ { "declarator": "unprocessed = new ByteBuffer()", "modifier": "private", "original_string": "private ByteBuffer unprocessed = new ByteBuffer();", "type": "ByteBuffer", "var_name": "unprocessed" }, { "declarator": "expected = 0", "modifier": "private"...
{ "body": "public void reset() {\n\t\thasUnprocessed = false;\n\t\tunprocessed.setBuffer(null);\n\t\texpected = 0;\n\t}", "class_method_signature": "Unprocessed.reset()", "constructor": false, "full_signature": "public void reset()", "identifier": "reset", "invocations": [ "setBuffer" ], "modifiers"...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_2
{ "fields": [], "file": "charset/src/test/java/org/smpp/charset/Gsm7BitCharsetProviderTest.java", "identifier": "Gsm7BitCharsetProviderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testCharsetName() {\n\t\tGsm7BitCharsetProvider provider = new Gsm7BitCharsetProvider();\n\t\tCharset charset = provider.charsetForName(\"X-Gsm7Bit\");\n\n\t\tassertNotNull(charset);\n\t}", "class_method_signature": "Gsm7BitCharsetProviderTest.testCharsetName()", "constructor": fal...
{ "fields": [ { "declarator": "CHARSET_NAME = \"X-Gsm7Bit\"", "modifier": "private static final", "original_string": "private static final String CHARSET_NAME = \"X-Gsm7Bit\";", "type": "String", "var_name": "CHARSET_NAME" }, { "declarator": "gsm7Bit = null", "mod...
{ "body": "public Charset charsetForName (String charsetName) {\n\t\tif(charsetName.equalsIgnoreCase(CHARSET_NAME)) {\n\t\t\treturn(gsm7Bit);\n\t\t}\n\t\treturn(null);\n\t}", "class_method_signature": "Gsm7BitCharsetProvider.charsetForName(String charsetName)", "constructor": false, "full_signature": "public Ch...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_16
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendStringWithCount() {\n\t\tbuffer.appendString(ABC, 2);\n\t\tassertBufferMatches(A, B);\n\t}", "class_method_signature": "ByteBufferTest.testAppendStringWithCount()", "constructor": false, "full_signature": "@Test public void testAppendStringWithCount()", "identifier": ...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendString(String string) {\n\t\ttry {\n\t\t\tappendString(string, Data.ENC_ASCII);\n\t\t} catch (UnsupportedEncodingException e) {\n // this can't happen as we use ASCII encoding\n // whatever is in the buffer it gets interpreted as ascii\n\t\t}\...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_41
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testRemoveCStringFromNullThrowsException() throws Exception {\n\t\tthrown.expect(NotEnoughDataInByteBufferException.class);\n\t\tthrown.expect(notEnoughData(1, 0));\n\n\t\tbuffer.removeCString();\n\t}", "class_method_signature": "ByteBufferTest.testRemoveCStringFromNullThrowsExceptio...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public String removeCString() throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException {\n\t\ttry {\n\t\t\treturn removeCString(Data.ENC_ASCII);\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t// this can't happen as we use ASCII encoding\n\t\t\t// whatever is in the buffer it get...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_82
{ "fields": [ { "declarator": "CLAZZ = ByteData.class", "modifier": "private static", "original_string": "private static Class<?> CLAZZ = ByteData.class;", "type": "Class<?>", "var_name": "CLAZZ" }, { "declarator": "thrown = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n\tpublic void testCheckCString() throws Exception {\n\t\tthrown.expect(stringLengthException(0, 0, 1));\n\t\tinvokeMethod(CLAZZ, \"checkCString\", (String) null, 0, 0);\n\t}", "class_method_signature": "ByteDataTest.testCheckCString()", "constructor": false, "full_signature": "@Test public voi...
{ "fields": [ { "declarator": "SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\"", "modifier": "private static final", "original_string": "private static final String SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\";", "type": "String", "var_name": "SMPP_TIME_DATE_FORMAT" }, { "declarat...
{ "body": "protected static void checkCString(String string, int max) throws WrongLengthOfStringException {\n\t\tcheckCString(string, 1, max); // min = empty + 1 for zero\n\t}", "class_method_signature": "ByteData.checkCString(String string, int max)", "constructor": false, "full_signature": "protected static v...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_83
{ "fields": [ { "declarator": "CLAZZ = ByteData.class", "modifier": "private static", "original_string": "private static Class<?> CLAZZ = ByteData.class;", "type": "Class<?>", "var_name": "CLAZZ" }, { "declarator": "thrown = ExpectedException.none()", "modifier": ...
{ "body": "@Test\n\tpublic void testCheckRange() throws Exception {\n\t\tcheckRange(0, 0, 0);\n\t\tcheckRange(0, 10, 100);\n\t}", "class_method_signature": "ByteDataTest.testCheckRange()", "constructor": false, "full_signature": "@Test public void testCheckRange()", "identifier": "testCheckRange", "invocati...
{ "fields": [ { "declarator": "SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\"", "modifier": "private static final", "original_string": "private static final String SMPP_TIME_DATE_FORMAT = \"yyMMddHHmmss\";", "type": "String", "var_name": "SMPP_TIME_DATE_FORMAT" }, { "declarat...
{ "body": "protected static void checkRange(int min, int val, int max) throws IntegerOutOfRangeException {\n\t\tif ((val < min) || (val > max)) {\n\t\t\tthrow new IntegerOutOfRangeException(min, max, val);\n\t\t}\n\t}", "class_method_signature": "ByteData.checkRange(int min, int val, int max)", "constructor": fal...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_40
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testRemoveIntReadsFirstInt() throws Exception {\n\t\tbuffer = bufferOf((byte) 0x01, (byte) 0x02, (byte) 0x03, (byte) 0x04, (byte) 0x05, (byte) 0x06, (byte) 0x07, (byte) 0x08);\n\t\tint i = buffer.removeInt();\n\t\tassertEquals((1 << 24) + (2 << 16) + (3 << 8) + 4, i);\n\t}", "class_m...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public int removeInt() throws NotEnoughDataInByteBufferException {\n\t\tint result = readInt();\n\t\tremoveBytes0(SZ_INT);\n\t\treturn result;\n\t}", "class_method_signature": "ByteBuffer.removeInt()", "constructor": false, "full_signature": "public int removeInt()", "identifier": "removeInt", "i...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_17
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendStringWithZeroCount() {\n\t\tbuffer = new ByteBuffer(new byte[] { });\n\t\tbuffer.appendString(ABC, 0);\n\t\tassertBufferMatches(new byte[] { });\n\t}", "class_method_signature": "ByteBufferTest.testAppendStringWithZeroCount()", "constructor": false, "full_signature": "...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendString(String string) {\n\t\ttry {\n\t\t\tappendString(string, Data.ENC_ASCII);\n\t\t} catch (UnsupportedEncodingException e) {\n // this can't happen as we use ASCII encoding\n // whatever is in the buffer it gets interpreted as ascii\n\t\t}\...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_3
{ "fields": [ { "declarator": "queue", "modifier": "private", "original_string": "private Queue queue;", "type": "Queue", "var_name": "queue" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\t...
{ "body": "@Test\n\tpublic void testConstructorLimitsSize() throws IndexOutOfBoundsException {\n\t\tthrown.expect(IndexOutOfBoundsException.class);\n\n\t\tqueue = new Queue(10);\n\t\tfor (int i = 0; i < 11; i++) {\n\t\t\tqueue.enqueue(new Object());\n\t\t}\n\t}", "class_method_signature": "QueueTest.testConstructor...
{ "fields": [ { "declarator": "maxQueueSize = 0", "modifier": "private", "original_string": "private int maxQueueSize = 0;", "type": "int", "var_name": "maxQueueSize" }, { "declarator": "queueData = new LinkedList<Object>()", "modifier": "private", "original...
{ "body": "public void enqueue(Object obj) throws IndexOutOfBoundsException {\n\t\tsynchronized (mutex) {\n\t\t\tif ((maxQueueSize > 0) && (size() >= maxQueueSize)) {\n\t\t\t\tthrow new IndexOutOfBoundsException(\"Queue is full. Element not added.\");\n\t\t\t}\n\t\t\tqueueData.add(obj);\n\t\t}\n\t}", "class_method_...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_56
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testHexDumpWithNullBuffer() {\n\t\tassertEquals(\"\", buffer.getHexDump());\n\t}", "class_method_signature": "ByteBufferTest.testHexDumpWithNullBuffer()", "constructor": false, "full_signature": "@Test public void testHexDumpWithNullBuffer()", "identifier": "testHexDumpWithNull...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public String getHexDump() {\n\t\tStringBuffer dump = new StringBuffer();\n\t\ttry {\n\t\t\tint dataLen = length();\n\t\t\tbyte[] buffer = getBuffer();\n\t\t\tfor (int i=0; i<dataLen; i++) {\n\t\t\t\tdump.append(Character.forDigit((buffer[i] >> 4) & 0x0f, 16));\n\t\t\t\tdump.append(Character.forDigit(buffe...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_21
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testAppendBytesWithCountHonoursCount() {\n\t\tbuffer.appendBytes(new byte[] { 0x01, 0x02, 0x03 }, 2);\n\t\tassertBufferMatches((byte) 0x01, (byte) 0x02);\n\t}", "class_method_signature": "ByteBufferTest.testAppendBytesWithCountHonoursCount()", "constructor": false, "full_signatur...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public void appendBytes(ByteBuffer bytes, int count) throws NotEnoughDataInByteBufferException {\n\t\tif (count > 0) {\n\t\t\tif (bytes == null) {\n\t\t\t\tthrow new NotEnoughDataInByteBufferException(0, count);\n\t\t\t}\n\t\t\tif (bytes.length() < count) {\n\t\t\t\tthrow new NotEnoughDataInByteBufferExcep...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_76
{ "fields": [ { "declarator": "TONS = new byte[] {\n\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07\n\t}", "modifier": "private static final", "original_string": "private static final byte[] TONS = new byte[] {\n\t\t0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07\n\t};", "type": "byte[]"...
{ "body": "@Test\n\tpublic void testDebugString() throws Exception {\n\t\tfor (byte ton : TONS) {\n\t\t\tfor (byte npi : NPIS) {\n\t\t\t\tfor (int len = 1; len <= MAX_ADDRESS_LENGTH; len++) {\n\t\t\t\t\tString a = address(len);\n\t\t\t\t\taddress = new Address(ton, npi, a, len + 1);\n\t\t\t\t\tString s = \"(addr: \" ...
{ "fields": [ { "declarator": "ton = Data.DFLT_GSM_TON", "modifier": "private", "original_string": "private byte ton = Data.DFLT_GSM_TON;", "type": "byte", "var_name": "ton" }, { "declarator": "npi = Data.DFLT_GSM_NPI", "modifier": "private", "original_strin...
{ "body": "public String debugString() {\n\t\tString dbgs = \"(addr: \";\n\t\tdbgs += super.debugString();\n\t\tdbgs += Integer.toString(getTon());\n\t\tdbgs += \" \";\n\t\tdbgs += Integer.toString(getNpi());\n\t\tdbgs += \" \";\n\t\tdbgs += getAddress();\n\t\tdbgs += \") \";\n\t\treturn dbgs;\n\t}", "class_method_...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_60
{ "fields": [ { "declarator": "out", "modifier": "private", "original_string": "private ByteArrayOutputStream out;", "type": "ByteArrayOutputStream", "var_name": "out" }, { "declarator": "event", "modifier": "private", "original_string": "private DefaultEven...
{ "body": "@Test\n\tpublic void testWrite() {\n\t\tevent.write(\"HELLO\");\n\t\tassertEquals(\"HELLO\" + newLine, out.toString());\n\t}", "class_method_signature": "DefaultEventTest.testWrite()", "constructor": false, "full_signature": "@Test public void testWrite()", "identifier": "testWrite", "invocations...
{ "fields": [ { "declarator": "active = false", "modifier": "private", "original_string": "private boolean active = false;", "type": "boolean", "var_name": "active" } ], "file": "core/src/main/java/org/smpp/debug/DefaultEvent.java", "identifier": "DefaultEvent", "interfac...
{ "body": "public void write(String msg) {\n\t\tif (active) {\n\t\t\tSystem.out.println(msg);\n\t\t}\n\t}", "class_method_signature": "DefaultEvent.write(String msg)", "constructor": false, "full_signature": "public void write(String msg)", "identifier": "write", "invocations": [ "println" ], "modif...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
8143599_37
{ "fields": [ { "declarator": "ABC = \"ABC\"", "modifier": "private static final", "original_string": "private static final String ABC = \"ABC\";", "type": "String", "var_name": "ABC" }, { "declarator": "ASCII = \"ASCII\"", "modifier": "private static final", ...
{ "body": "@Test\n\tpublic void testReadIntFromSmallBufferThrowsException() throws Exception {\n\t\tthrown.expect(NotEnoughDataInByteBufferException.class);\n\t\tthrown.expect(notEnoughData(4, 2));\n\n\t\tbuffer = bufferOf(NULL, NULL);\n\t\tbuffer.readInt();\n\t}", "class_method_signature": "ByteBufferTest.testRead...
{ "fields": [ { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "SZ_BYTE = 1", "modifier": "private static final", "original_string": "private static final ...
{ "body": "public int readInt() throws NotEnoughDataInByteBufferException {\n\t\tint result = 0;\n\t\tint len = length();\n\t\tif (len >= SZ_INT) {\n\t\t\tresult |= buffer[0] & 0xff;\n\t\t\tresult <<= 8;\n\t\t\tresult |= buffer[1] & 0xff;\n\t\t\tresult <<= 8;\n\t\t\tresult |= buffer[2] & 0xff;\n\t\t\tresult <<= 8;\n\...
{ "created": null, "fork": null, "fork_count": 139, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 8143599, "size": 2751, "stargazer_count": 141, "stars": null, "updates": null, "url": "https://github.com/OpenSmpp/opensmpp" }
66136602_9
{ "fields": [], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/FileUtilsTest.java", "identifier": "FileUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testUnpackPackage() throws Exception {\n File tmpoutdir = new File(\"/Users/netease/webcacheunittestfiles/\", \"tmpoutdir\");\n FileUtils.deleteDir(tmpoutdir);\n assertTrue(tmpoutdir.mkdirs());\n\n String filePath = \"/Users/netease/webcacheunittestfiles/w...
{ "fields": [], "file": "candywebcache/src/main/java/com/netease/hearttouch/candywebcache/cachemanager/FileUtils.java", "identifier": "FileUtils", "interfaces": "", "methods": [ { "class_method_signature": "FileUtils.getPrimaryFileName(String filepath)", "constructor": false, "full_signa...
{ "body": "private static boolean unpackPackage(File ourDir, InputStream is, Map<String, String> md5List,\n CompressMode mode) {\n if (!ourDir.exists()) {\n return false;\n }\n\n boolean uncompressResult = false;\n if (mode == CompressMode...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_5
{ "fields": [ { "declarator": "mCache", "modifier": "private", "original_string": "private MemBasedCache mCache;", "type": "MemBasedCache", "var_name": "mCache" } ], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/MemBasedCacheTest.java"...
{ "body": "@Test\n public void testInvalidate() throws Exception {\n testLoadFiles();\n\n String key = \"cloudmusic/web_app_new_cloudmusic/tp_module_resource_interface_create_index.js\";\n Cache.Entry entry = mCache.get(key);\n long totalSizeBefore = mCache.totalDataSize();\n ass...
{ "fields": [ { "declarator": "DEFAULT_MEMORY_USAGE_BYTES = (int)Runtime.getRuntime().maxMemory() / 8 > 0 ?\n (int)Runtime.getRuntime().maxMemory() / 8 : 4 * 1024 * 1024", "modifier": "private static final", "original_string": "private static final int DEFAULT_MEMORY_USAGE_BYTES = (in...
{ "body": "@Override\n public synchronized void invalidate(String key, boolean fullExpire) {\n remove(key);\n }", "class_method_signature": "MemBasedCache.invalidate(String key, boolean fullExpire)", "constructor": false, "full_signature": "@Override public synchronized void invalidate(String key, ...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_4
{ "fields": [ { "declarator": "mCache", "modifier": "private", "original_string": "private MemBasedCache mCache;", "type": "MemBasedCache", "var_name": "mCache" } ], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/MemBasedCacheTest.java"...
{ "body": "@Test\n public void testRemove() throws Exception {\n testLoadFiles();\n\n String key = \"cloudmusic/web_app_new_cloudmusic/tp_module_resource_interface_create_index.js\";\n Cache.Entry entry = mCache.get(key);\n long totalSizeBefore = mCache.totalDataSize();\n assertN...
{ "fields": [ { "declarator": "DEFAULT_MEMORY_USAGE_BYTES = (int)Runtime.getRuntime().maxMemory() / 8 > 0 ?\n (int)Runtime.getRuntime().maxMemory() / 8 : 4 * 1024 * 1024", "modifier": "private static final", "original_string": "private static final int DEFAULT_MEMORY_USAGE_BYTES = (in...
{ "body": "@Override\n public synchronized void remove(String key) {\n CacheHeader entry = mDataEntries.get(key);\n // if the entry does not exist, return.\n if (entry != null) {\n mTotalSize -= entry.data.length;\n mDataEntries.remove(key);\n }\n }", "class_m...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_12
{ "fields": [], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/Md5UtilsTest.java", "identifier": "Md5UtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCheckFileValidation() throws Exception {\n String filePath1 = \"/Users/netease/webcacheunittestfiles/web_app_old.zip\";\n String md5_1 = \"1ab73685e5fbb4269d5c1432c232a574\";\n assertTrue(Md5Utils.checkFileValidation(filePath1, md5_1));\n\n String file...
{ "fields": [ { "declarator": "sHexChar = { '0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }", "modifier": "private static", "original_string": "private static char[] sHexChar = { '0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b'...
{ "body": "public static boolean checkFileValidation(String filePath, String md5) {\n String strDigest = calculateMd5(filePath);\n if (strDigest.equalsIgnoreCase(md5)) {\n return true;\n }\n return false;\n }", "class_method_signature": "Md5Utils.checkFileValidation(String ...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_8
{ "fields": [], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/FileUtilsTest.java", "identifier": "FileUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetPrimaryFileName() throws Exception {\n String filePath1 = \"/Users/netease/abcdefg.tar.gz\";\n assertEquals(FileUtils.getPrimaryFileName(filePath1), \"abcdefg\");\n String filePath2 = \"/Users/netease/.tar.gz\";\n assertEquals(FileUtils.getPrimaryFi...
{ "fields": [], "file": "candywebcache/src/main/java/com/netease/hearttouch/candywebcache/cachemanager/FileUtils.java", "identifier": "FileUtils", "interfaces": "", "methods": [ { "class_method_signature": "FileUtils.getPrimaryFileName(String filepath)", "constructor": false, "full_signa...
{ "body": "public static String getPrimaryFileName(String filepath) {\n File file = new File(filepath);\n if (file.isDirectory()) {\n return file.getName();\n }\n String filename = file.getName();\n String primaryFileName = filename;\n if (filename.endsWith(\".tgz\...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_3
{ "fields": [ { "declarator": "mCache", "modifier": "private", "original_string": "private MemBasedCache mCache;", "type": "MemBasedCache", "var_name": "mCache" } ], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/MemBasedCacheTest.java"...
{ "body": "@Test\n public void testGet1() throws Exception {\n testLoadFiles();\n Cache.Entry entry = mCache.get(\"cloudmusic/web_app_new_cloudmusic/tp_module_resource_interface_create_index.js\");\n assertNotNull(entry);\n\n entry = mCache.get(\"cloudmusic/web_app_new_cloudmusic/tp_mod...
{ "fields": [ { "declarator": "DEFAULT_MEMORY_USAGE_BYTES = (int)Runtime.getRuntime().maxMemory() / 8 > 0 ?\n (int)Runtime.getRuntime().maxMemory() / 8 : 4 * 1024 * 1024", "modifier": "private static final", "original_string": "private static final int DEFAULT_MEMORY_USAGE_BYTES = (in...
{ "body": "@Override\n public synchronized Entry get(String key) {\n CacheHeader entry = mDataEntries.get(key);\n // if the entry does not exist, return.\n if (entry == null) {\n return null;\n }\n Entry e = new Entry();\n e.data = entry.data;\n return e;...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_2
{ "fields": [ { "declarator": "mCache", "modifier": "private", "original_string": "private MemBasedCache mCache;", "type": "MemBasedCache", "var_name": "mCache" } ], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/MemBasedCacheTest.java"...
{ "body": "@Test\n public void testGet() throws Exception {\n testLoadFiles();\n Cache.Entry entry = mCache.get(\"kaola/web_app_old_kaola/module/dashboard/index.html\");\n assertNotNull(entry);\n\n entry = mCache.get(\"kaola/web_app_old_kaola/module/resource/interface/index.html\");\n ...
{ "fields": [ { "declarator": "DEFAULT_MEMORY_USAGE_BYTES = (int)Runtime.getRuntime().maxMemory() / 8 > 0 ?\n (int)Runtime.getRuntime().maxMemory() / 8 : 4 * 1024 * 1024", "modifier": "private static final", "original_string": "private static final int DEFAULT_MEMORY_USAGE_BYTES = (in...
{ "body": "@Override\n public synchronized Entry get(String key) {\n CacheHeader entry = mDataEntries.get(key);\n // if the entry does not exist, return.\n if (entry == null) {\n return null;\n }\n Entry e = new Entry();\n e.data = entry.data;\n return e;...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_1
{ "fields": [ { "declarator": "mCache", "modifier": "private", "original_string": "private MemBasedCache mCache;", "type": "MemBasedCache", "var_name": "mCache" } ], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/MemBasedCacheTest.java"...
{ "body": "@Test\n public void testPut() throws Exception {\n testLoadFiles();\n }", "class_method_signature": "MemBasedCacheTest.testPut()", "constructor": false, "full_signature": "@Test public void testPut()", "identifier": "testPut", "invocations": [ "testLoadFiles" ], "modifiers": ...
{ "fields": [ { "declarator": "DEFAULT_MEMORY_USAGE_BYTES = (int)Runtime.getRuntime().maxMemory() / 8 > 0 ?\n (int)Runtime.getRuntime().maxMemory() / 8 : 4 * 1024 * 1024", "modifier": "private static final", "original_string": "private static final int DEFAULT_MEMORY_USAGE_BYTES = (in...
{ "body": "@Override\n public synchronized void put(String key, Entry entry) {\n pruneIfNeeded(entry.data.length);\n CacheHeader e = new CacheHeader(key, entry);\n if (!mDataEntries.containsKey(key)) {\n mTotalSize += e.data.length;\n } else {\n CacheHeader oldEntr...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_0
{ "fields": [ { "declarator": "mCache", "modifier": "private", "original_string": "private MemBasedCache mCache;", "type": "MemBasedCache", "var_name": "mCache" } ], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/MemBasedCacheTest.java"...
{ "body": "@Test\n public void testInitialize() throws Exception {\n mCache.initialize();\n assertTrue(true);\n }", "class_method_signature": "MemBasedCacheTest.testInitialize()", "constructor": false, "full_signature": "@Test public void testInitialize()", "identifier": "testInitialize", ...
{ "fields": [ { "declarator": "DEFAULT_MEMORY_USAGE_BYTES = (int)Runtime.getRuntime().maxMemory() / 8 > 0 ?\n (int)Runtime.getRuntime().maxMemory() / 8 : 4 * 1024 * 1024", "modifier": "private static final", "original_string": "private static final int DEFAULT_MEMORY_USAGE_BYTES = (in...
{ "body": "@Override\n public synchronized void initialize() {\n\n }", "class_method_signature": "MemBasedCache.initialize()", "constructor": false, "full_signature": "@Override public synchronized void initialize()", "identifier": "initialize", "invocations": [], "modifiers": "@Override public sync...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_11
{ "fields": [], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/Md5UtilsTest.java", "identifier": "Md5UtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCalculateMd5() throws Exception {\n String filePath1 = \"/Users/netease/webcacheunittestfiles/web_app_old.zip\";\n String md5_1 = \"1ab73685e5fbb4269d5c1432c232a574\";\n assertEquals(md5_1, Md5Utils.calculateMd5(filePath1));\n\n String filePath2 = \"/U...
{ "fields": [ { "declarator": "sHexChar = { '0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }", "modifier": "private static", "original_string": "private static char[] sHexChar = { '0', '1', '2', '3', '4', '5', '6', '7',\n '8', '9', 'a', 'b'...
{ "body": "public static String calculateMd5(InputStream is) {\n String md5 = \"\";\n try {\n MessageDigest md5Digest = MessageDigest.getInstance(\"MD5\");\n\n byte[] buffer = new byte[4096];\n int numRead;\n\n while ((numRead = is.read(buffer)) > 0) {\n ...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_7
{ "fields": [], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/FileUtilsTest.java", "identifier": "FileUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetExtName() throws Exception {\n String filePath1 = \"/Users/netease/abcdefg.tar.gz\";\n assertEquals(FileUtils.getExtName(filePath1), \".tar.gz\");\n String filePath2 = \"/Users/netease/.tar.gz\";\n assertEquals(FileUtils.getExtName(filePath2), \".ta...
{ "fields": [], "file": "candywebcache/src/main/java/com/netease/hearttouch/candywebcache/cachemanager/FileUtils.java", "identifier": "FileUtils", "interfaces": "", "methods": [ { "class_method_signature": "FileUtils.getPrimaryFileName(String filepath)", "constructor": false, "full_signa...
{ "body": "public static String getExtName(String filepath) {\n File file = new File(filepath);\n String filename = file.getName();\n if (filename.endsWith(\".tar.gz\")) {\n return \".tar.gz\";\n }\n if (filename.lastIndexOf('.') > 0) {\n return filename.substr...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_6
{ "fields": [ { "declarator": "mCache", "modifier": "private", "original_string": "private MemBasedCache mCache;", "type": "MemBasedCache", "var_name": "mCache" } ], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/MemBasedCacheTest.java"...
{ "body": "@Test\n public void testClear() throws Exception {\n testLoadFiles();\n Cache.Entry entry = mCache.get(\"cloudmusic/web_app_new_cloudmusic/tp_module_resource_interface_create_index.js\");\n assertNotNull(entry);\n\n entry = mCache.get(\"cloudmusic/web_app_new_cloudmusic/tp_mo...
{ "fields": [ { "declarator": "DEFAULT_MEMORY_USAGE_BYTES = (int)Runtime.getRuntime().maxMemory() / 8 > 0 ?\n (int)Runtime.getRuntime().maxMemory() / 8 : 4 * 1024 * 1024", "modifier": "private static final", "original_string": "private static final int DEFAULT_MEMORY_USAGE_BYTES = (in...
{ "body": "@Override\n public synchronized void clear() {\n mDataEntries.clear();\n mTotalSize = 0;\n }", "class_method_signature": "MemBasedCache.clear()", "constructor": false, "full_signature": "@Override public synchronized void clear()", "identifier": "clear", "invocations": [ "...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
66136602_10
{ "fields": [], "file": "candywebcache/src/test/java/com/netease/hearttouch/candywebcache/cachemanager/FileUtilsTest.java", "identifier": "FileUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testDeleteDir() throws Exception {\n File dir = new File(\"/Users/netease/webcacheunittestfiles/web_app_new\");\n if (!dir.exists()) {\n String shpath = \"/Users/netease/webcacheunittestfiles/unzip.sh\";\n Process ps = Runtime.getRuntime().exec(shp...
{ "fields": [], "file": "candywebcache/src/main/java/com/netease/hearttouch/candywebcache/cachemanager/FileUtils.java", "identifier": "FileUtils", "interfaces": "", "methods": [ { "class_method_signature": "FileUtils.getPrimaryFileName(String filepath)", "constructor": false, "full_signa...
{ "body": "public static boolean deleteDir(File dir) {\n if (!dir.exists()) {\n return true;\n }\n LinkedList<File> deleteCandidatFiles = new LinkedList<>();\n deleteCandidatFiles.addFirst(dir);\n while (!deleteCandidatFiles.isEmpty()) {\n File file = deleteCan...
{ "created": null, "fork": null, "fork_count": 23, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 66136602, "size": 2533, "stargazer_count": 186, "stars": null, "updates": null, "url": "https://github.com/NEYouFan/ht-candywebcache-android" }
14640193_0
{ "fields": [], "file": "AIMSICD/src/test/java/com/secupwn/aimsicd/utils/MiscUtilsTest.java", "identifier": "MiscUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParseLogcatTimeStamp() throws Exception {\n Date date = MiscUtils.parseLogcatTimeStamp(\"03-31 01:04:39.348 14308-14308/com.SecUpwN.AIMSICD I/SignalStrengthTracker: Ignored signal sample for\");\n\n assertEquals(2, date.getMonth()); //Month is 0 based\n asser...
{ "fields": [ { "declarator": "LOGCAT_TIMESTAMP_PATTERN = Pattern.compile(\"^(\\\\d{2})-(\\\\d{2}) (\\\\d{2}):(\\\\d{2}):(\\\\d{2}).(\\\\d{3})\")", "modifier": "public static final", "original_string": "public static final Pattern LOGCAT_TIMESTAMP_PATTERN = Pattern.compile(\"^(\\\\d{2})-(\\\\d{2...
{ "body": "public static Date parseLogcatTimeStamp(String line) {\n Matcher matcher = LOGCAT_TIMESTAMP_PATTERN.matcher(line);\n\n if (matcher.find()) {\n int month = Integer.valueOf(matcher.group(1));\n int day = Integer.valueOf(matcher.group(2));\n\n int hour = Integer....
{ "created": null, "fork": null, "fork_count": 808, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 14640193, "size": 11006, "stargazer_count": 3809, "stars": null, "updates": null, "url": "https://github.com/CellularPrivacy/Android-IMSI-Catcher-Detector" }
45257264_44
{ "fields": [ { "declarator": "remoteGitHelper", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate RemoteGitHelper remoteGitHelper;", "type": "RemoteGitHelper", "var_name": "remoteGitHelper" }, { "declarator": "connection", "modifi...
{ "body": "@Test\n\tpublic void testIsGitInstalledReturnsFalse() throws IOException {\n\t\twhen(connection.tryExecute(\"which\", \"git\")).thenReturn(\n\t\t\t\tnew ExecutionResult(1, \"\", \"\"));\n\t\tassertThat(remoteGitHelper.isGitInstalled(connection), is(false));\n\t}", "class_method_signature": "RemoteGitHelp...
{ "fields": [], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/scm/git/RemoteGitHelper.java", "identifier": "RemoteGitHelper", "interfaces": "", "methods": [ { "class_method_signature": "RemoteGitHelper.RemoteGitHelper()", "constructor": true, "full_signature": ...
{ "body": "public boolean isGitInstalled(SshConnection connection) throws IOException {\n\t\tExecutionResult result = connection.tryExecute(\"which\", \"git\");\n\t\tif (result.getExitCode() == 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (result.getExitCode() == 1) {\n\t\t\treturn false;\n\t\t}\n\t\tthrow new ProgramExec...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_13
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tSshConfigParser parser;", "type": "SshConfigParser", "var_name": "parser" }, { "declarator": "VAGRANT_CONFIG = \"Host default\\n\"\n\t\t\t+ \" HostName 127.0.0.1\\n\...
{ "body": "@Test\n\tpublic void testVerifyHostKeyIsTrueByDefault() {\n\t\tSshConfig config = parser.parse(\"HostName 127.0.0.1\\nUser me\");\n\t\tassertThat(config.getVerifyHostKey(), is(true));\n\t}", "class_method_signature": "SshConfigParserTest.testVerifyHostKeyIsTrueByDefault()", "constructor": false, "ful...
{ "fields": [ { "declarator": "DEFAULT_PORT = 22", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 22;", "type": "int", "var_name": "DEFAULT_PORT" } ], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/com...
{ "body": "public SshConfig parse(String configStr) {\n\t\tMutableSshConfig result = new MutableSshConfig();\n\t\tfor (String line : configStr.split(\"\\n\")) {\n\t\t\tline = line.trim();\n\t\t\tString[] splits = line.split(\"\\\\s\", 2);\n\t\t\tif (splits.length != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString key ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_29
{ "fields": [ { "declarator": "boxes", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantBoxes boxes;", "type": "VagrantBoxes", "var_name": "boxes" } ], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/vagrant/VagrantBoxe...
{ "body": "@Test\n\tpublic void testHasSystem() {\n\t\tassertThat(boxes.hasSystem(SystemSpecification.UBUNTU_1404), is(true));\n\t\tassertThat(boxes.hasSystem(new SystemSpecification(OperatingSystem.LINUX,\n\t\t\t\tArchitecture.X86_64, \"nonexistant\", \"1.0\")), is(false));\n\t}", "class_method_signature": "Vagran...
{ "fields": [ { "declarator": "BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecification.UBUNTU_1404)", "modifier": "private static final", "original_string": "private static final Map<String, SystemSpecification> BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecific...
{ "body": "public boolean hasSystem(SystemSpecification spec) {\n\t\treturn REVERSE.containsKey(spec);\n\t}", "class_method_signature": "VagrantBoxes.hasSystem(SystemSpecification spec)", "constructor": false, "full_signature": "public boolean hasSystem(SystemSpecification spec)", "identifier": "hasSystem", ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_7
{ "fields": [], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/LocalCommandExecutorTest.java", "identifier": "LocalCommandExecutorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testExitCode1() throws IOException, InterruptedException {\n\t\tCommandExecutor executor = new LocalCommandExecutor();\n\t\tExecutionResult result = executor.tryExecute(\"false\");\n\t\tassertThat(result.getExitCode(), is(1));\n\t}", "class_method_signature": "LocalCommandExecutorTes...
{ "fields": [ { "declarator": "logger = Logger.getLogger(LocalCommandExecutor.class)", "modifier": "private final", "original_string": "private final Logger logger = Logger.getLogger(LocalCommandExecutor.class);", "type": "Logger", "var_name": "logger" } ], "file": "bugminer-...
{ "body": "@Override\n\tpublic ExecutionResult tryExecute(Path workingDirectory, String... cmd) throws IOException {\n\t\tlogger.debug(\"Executing `\" + StringUtils.join(cmd, ' ') + \" in \" + workingDirectory);\n\t\tFile workdir = workingDirectory == null ? null : workingDirectory.toFile();\n\t\tProcess process = Ru...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_48
{ "fields": [ { "declarator": "remoteGitHelper", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate RemoteGitHelper remoteGitHelper;", "type": "RemoteGitHelper", "var_name": "remoteGitHelper" }, { "declarator": "connection", "modifi...
{ "body": "@Test(expected = IOException.class)\n\tpublic void testInstallGitThrowsIfNotAvailableAfterwards() throws IOException {\n\t\twhen(connection.tryExecute(\"which\", \"git\"))\n\t\t\t\t.thenReturn(new ExecutionResult(1, \"\", \"\"))\n\t\t\t\t.thenReturn(new ExecutionResult(1, \"\", \"\")); // still not install...
{ "fields": [], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/scm/git/RemoteGitHelper.java", "identifier": "RemoteGitHelper", "interfaces": "", "methods": [ { "class_method_signature": "RemoteGitHelper.RemoteGitHelper()", "constructor": true, "full_signature": ...
{ "body": "public void installGit(SshConnection connection, SystemSpecification os) throws IOException {\n\t\tif (isGitInstalled(connection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!SystemSpecification.UBUNTU.equals(os.getDistributionName())) {\n\t\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\t\"Only ubuntu is s...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_33
{ "fields": [ { "declarator": "boxes", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantBoxes boxes;", "type": "VagrantBoxes", "var_name": "boxes" } ], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/vagrant/VagrantBoxe...
{ "body": "@Test\n\tpublic void testGetNames() {\n\t\tassertThat(boxes.getNames(), hasItem(\"ubuntu/trusty64\"));\n\t}", "class_method_signature": "VagrantBoxesTest.testGetNames()", "constructor": false, "full_signature": "@Test public void testGetNames()", "identifier": "testGetNames", "invocations": [ ...
{ "fields": [ { "declarator": "BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecification.UBUNTU_1404)", "modifier": "private static final", "original_string": "private static final Map<String, SystemSpecification> BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecific...
{ "body": "public Collection<String> getNames() {\n\t\treturn BOXES.keySet();\n\t}", "class_method_signature": "VagrantBoxes.getNames()", "constructor": false, "full_signature": "public Collection<String> getNames()", "identifier": "getNames", "invocations": [ "keySet" ], "modifiers": "public", "p...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_25
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@Test\n\tpublic void testStopNode() throws IOException {\n\t\tFiles.createDirectories(vagrantPath);\n\n\t\tstrategy.stopNode(prepareNode());\n\n\t\tverify(executor).execute(vagrantPath, \"vagrant\", \"halt\");\n\t}", "class_method_signature": "VagrantStrategyTest.testStopNode()", "constructor": false, ...
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "@Override\n\tpublic void stopNode(Node node) throws IOException {\n\t\tPath nodePath = getPath(node);\n\t\tif (!Files.exists(nodePath)) {\n\t\t\treturn;\n\t\t}\n\t\texecutor.execute(nodePath, \"vagrant\", \"halt\");\n\t}", "class_method_signature": "VagrantStrategy.stopNode(Node node)", "constructor": ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_24
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@Test\n\tpublic void testStartNode() throws IOException {\n\t\tFiles.createDirectories(vagrantPath);\n\n\t\tstrategy.startNode(prepareNode());\n\n\t\tverify(executor).execute(vagrantPath, \"vagrant\", \"up\");\n\t}", "class_method_signature": "VagrantStrategyTest.testStartNode()", "constructor": false,...
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "@Override\n\tpublic void startNode(Node node) throws IOException {\n\t\texecutor.execute(getPath(node), \"vagrant\", \"up\");\n\t}", "class_method_signature": "VagrantStrategy.startNode(Node node)", "constructor": false, "full_signature": "@Override public void startNode(Node node)", "identifier": ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_32
{ "fields": [ { "declarator": "boxes", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantBoxes boxes;", "type": "VagrantBoxes", "var_name": "boxes" } ], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/vagrant/VagrantBoxe...
{ "body": "@Test\n\tpublic void testGetSystems() {\n\t\tassertThat(boxes.getSystems(), hasItem(SystemSpecification.UBUNTU_1404));\n\t}", "class_method_signature": "VagrantBoxesTest.testGetSystems()", "constructor": false, "full_signature": "@Test public void testGetSystems()", "identifier": "testGetSystems", ...
{ "fields": [ { "declarator": "BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecification.UBUNTU_1404)", "modifier": "private static final", "original_string": "private static final Map<String, SystemSpecification> BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecific...
{ "body": "public Collection<SystemSpecification> getSystems() {\n\t\treturn BOXES.values();\n\t}", "class_method_signature": "VagrantBoxes.getSystems()", "constructor": false, "full_signature": "public Collection<SystemSpecification> getSystems()", "identifier": "getSystems", "invocations": [ "values" ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_49
{ "fields": [ { "declarator": "remoteGitHelper", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate RemoteGitHelper remoteGitHelper;", "type": "RemoteGitHelper", "var_name": "remoteGitHelper" }, { "declarator": "connection", "modifi...
{ "body": "@Test\n\tpublic void testCheckoutHard() throws IOException {\n\t\tremoteGitHelper.checkoutHard(connection, \"remote-path\", \"abc123\");\n\t\tverify(connection).executeIn(\"remote-path\", \"git\", \"checkout\", \"-f\", \"abc123\");\n\t\tverify(connection).executeIn(\"remote-path\", \"git\", \"clean\", \"-f...
{ "fields": [], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/scm/git/RemoteGitHelper.java", "identifier": "RemoteGitHelper", "interfaces": "", "methods": [ { "class_method_signature": "RemoteGitHelper.RemoteGitHelper()", "constructor": true, "full_signature": ...
{ "body": "public void checkoutHard(SshConnection connection, String remotePath, String revision)\n\t\t\tthrows IOException {\n\t\tconnection.executeIn(remotePath, \"git\", \"checkout\", \"-f\", revision);\n\t\tconnection.executeIn(remotePath, \"git\", \"reset\", \"--hard\");\n\t\tconnection.executeIn(remotePath, \"g...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_6
{ "fields": [], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/LocalCommandExecutorTest.java", "identifier": "LocalCommandExecutorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n\tpublic void testExitCode0() throws IOException, InterruptedException {\n\t\tCommandExecutor executor = new LocalCommandExecutor();\n\t\tExecutionResult result = executor.tryExecute(\"true\");\n\t\tassertThat(result.getExitCode(), is(0));\n\t}", "class_method_signature": "LocalCommandExecutorTest...
{ "fields": [ { "declarator": "logger = Logger.getLogger(LocalCommandExecutor.class)", "modifier": "private final", "original_string": "private final Logger logger = Logger.getLogger(LocalCommandExecutor.class);", "type": "Logger", "var_name": "logger" } ], "file": "bugminer-...
{ "body": "@Override\n\tpublic ExecutionResult tryExecute(Path workingDirectory, String... cmd) throws IOException {\n\t\tlogger.debug(\"Executing `\" + StringUtils.join(cmd, ' ') + \" in \" + workingDirectory);\n\t\tFile workdir = workingDirectory == null ? null : workingDirectory.toFile();\n\t\tProcess process = Ru...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_28
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@Test\n\tpublic void testGetSshConfig() throws IOException {\n\t\tSshConfig config = new SshConfig(\"localhost\", 22, \"vagrant\");\n\t\tFiles.createDirectories(vagrantPath);\n\t\twhen(executor.execute(vagrantPath, \"vagrant\", \"ssh-config\")).thenReturn(\n\t\t\t\tnew ExecutionResult(0, \"the ssh result\"...
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "public SshConfig getSshConfig(Node node) throws IOException {\n\t\tPath nodePath = getPath(node);\n\t\tString sshConfigStr = executor.execute(nodePath, \"vagrant\", \"ssh-config\").getOutput();\n\t\ttry {\n\t\t\treturn sshConfigParser.parse(sshConfigStr);\n\t\t} catch (InvalidSshConfigException e) {\n\t\t\...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_12
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tSshConfigParser parser;", "type": "SshConfigParser", "var_name": "parser" }, { "declarator": "VAGRANT_CONFIG = \"Host default\\n\"\n\t\t\t+ \" HostName 127.0.0.1\\n\...
{ "body": "@Test\n\tpublic void testFallsBackToDefaultPort() {\n\t\tSshConfig config = parser.parse(\"HostName 127.0.0.1\\nUser me\");\n\t\tassertThat(config.getPort(), is(22));\n\t}", "class_method_signature": "SshConfigParserTest.testFallsBackToDefaultPort()", "constructor": false, "full_signature": "@Test pu...
{ "fields": [ { "declarator": "DEFAULT_PORT = 22", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 22;", "type": "int", "var_name": "DEFAULT_PORT" } ], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/com...
{ "body": "public SshConfig parse(String configStr) {\n\t\tMutableSshConfig result = new MutableSshConfig();\n\t\tfor (String line : configStr.split(\"\\n\")) {\n\t\t\tline = line.trim();\n\t\t\tString[] splits = line.split(\"\\\\s\", 2);\n\t\t\tif (splits.length != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString key ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_45
{ "fields": [ { "declarator": "remoteGitHelper", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate RemoteGitHelper remoteGitHelper;", "type": "RemoteGitHelper", "var_name": "remoteGitHelper" }, { "declarator": "connection", "modifi...
{ "body": "@Test(expected = IOException.class)\n\tpublic void testIsGitInstalledThrows() throws IOException {\n\t\twhen(connection.tryExecute(\"which\", \"git\")).thenReturn(\n\t\t\t\tnew ExecutionResult(3, \"\", \"unexpected result\"));\n\t\tremoteGitHelper.isGitInstalled(connection);\n\t}", "class_method_signatur...
{ "fields": [], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/scm/git/RemoteGitHelper.java", "identifier": "RemoteGitHelper", "interfaces": "", "methods": [ { "class_method_signature": "RemoteGitHelper.RemoteGitHelper()", "constructor": true, "full_signature": ...
{ "body": "public boolean isGitInstalled(SshConnection connection) throws IOException {\n\t\tExecutionResult result = connection.tryExecute(\"which\", \"git\");\n\t\tif (result.getExitCode() == 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (result.getExitCode() == 1) {\n\t\t\treturn false;\n\t\t}\n\t\tthrow new ProgramExec...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_19
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStatusParser parser;", "type": "VagrantStatusParser", "var_name": "parser" }, { "declarator": "OUTPUT = \"Current machine states:%n%n\"\n\t\t\t+ \"default ...
{ "body": "@Test\n\tpublic void testParseStatusString() {\n\t\tassertThat(parser.parseStatusString(\"running\"), is(NodeStatus.ONLINE));\n\t\tassertThat(parser.parseStatusString(\"poweroff\"), is(NodeStatus.OFFLINE));\n\t\tassertThat(parser.parseStatusString(\"saved\"), is(NodeStatus.OFFLINE));\n\t\tassertThat(parser...
{ "fields": [ { "declarator": "STATUS_LINE_PATTERN = \"\\\\s*([\\\\S]+)\\\\s+([^\\\\)]+)\\\\s*\\\\(.*\"", "modifier": "private static final", "original_string": "private static final String STATUS_LINE_PATTERN = \"\\\\s*([\\\\S]+)\\\\s+([^\\\\)]+)\\\\s*\\\\(.*\";", "type": "String", ...
{ "body": "public NodeStatus parseStatusString(String status) {\n\t\tif (!STATUS_STRINGS.containsKey(status)) {\n\t\t\treturn NodeStatus.UNKNOWN;\n\t\t}\n\t\treturn STATUS_STRINGS.get(status);\n\t}", "class_method_signature": "VagrantStatusParser.parseStatusString(String status)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_35
{ "fields": [ { "declarator": "taskIsRun = false", "modifier": "private", "original_string": "private boolean taskIsRun = false;", "type": "boolean", "var_name": "taskIsRun" }, { "declarator": "taskStateWhenRunWasCalled", "modifier": "private", "original_str...
{ "body": "@Test\n\tpublic void testRun() {\n\t\ttask = new SimpleTask(\"Test Task\", c -> {\n\t\t\ttaskStateWhenRunWasCalled = task.getState();\n\t\t\ttaskIsRun = true;\n\t\t});\n\t\ttask.run();\n\t\tassertThat(taskStateWhenRunWasCalled, is(TaskState.RUNNING));\n\t\tassertThat(task.getState(), is(TaskState.FINISHED)...
{ "fields": [ { "declarator": "title", "modifier": "private", "original_string": "private String title;", "type": "String", "var_name": "title" }, { "declarator": "context = new TaskContext()", "modifier": "@JsonIgnore\n\tprivate", "original_string": "@JsonI...
{ "body": "@Override\n\tpublic void run() {\n\t\tif (state != TaskState.SCHEDULED && state != TaskState.INITIALIZING) {\n\t\t\tthrow new IllegalStateException(\"Can only run in SCHEDULED or INITIALIZING state, but is \" + state);\n\t\t}\n\t\tstate = TaskState.RUNNING;\n\t\tLOGGER.info(\"Task started: \" + title);\n\t...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_23
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@Test\n\tpublic void testInitializeNode() throws IOException {\n\t\twhen(boxes.hasSystem(SPEC)).thenReturn(true);\n\t\twhen(boxes.getName(SPEC)).thenReturn(BOX_NAME);\n\n\t\tCluster cluster = mock(Cluster.class);\n\t\twhen(cluster.getName()).thenReturn(VagrantTestData.CLUSTER_NAME);\n\t\tNode node = strate...
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "@Override\n\tpublic Node createNode(Cluster cluster) throws IOException {\n\t\tNode node = new Node();\n\t\tnode.setSystemSpecification(SystemSpecification.UBUNTU_1404);\n\t\tnode.setCluster(cluster);\n\t\tPath nodePath = getPath(node);\n\t\tif (Files.exists(nodePath)) {\n\t\t\tthrow new IOException(\"The ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_42
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate GitStrategy strategy;", "type": "GitStrategy", "var_name": "strategy" }, { "declarator": "gitFactory", "modifier": "@Mock\n\tprivate", ...
{ "body": "@Test\n\tpublic void testPushToWithAbsolutePath() throws IOException, GitAPIException {\n\t\tstrategy.pushTo(repo, nodeConnection, \"/absolute/path\", revision);\n\t\tverify(pushCommand).setRemote(\"ssh://sshuser@localhost:22/absolute/path\");\n\t}", "class_method_signature": "GitStrategyTest.testPushToW...
{ "fields": [ { "declarator": "gitFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate GitFactory gitFactory;", "type": "GitFactory", "var_name": "gitFactory" }, { "declarator": "dataDir", "modifier": "@Autowired\n\t@DataDirecto...
{ "body": "@Override\n\tpublic void pushTo(CodeRepo repo, NodeConnection node, String remotePath, CodeRevision revision)\n\t\t\tthrows IOException {\n\t\tinitRepository(node, remotePath);\n\n\t\tGit git = open(repo);\n\t\tRefSpec refspec = new RefSpec()\n\t\t\t\t.setSource(revision.getCommitId())\n\t\t\t\t.setDestina...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_15
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tSshConfigParser parser;", "type": "SshConfigParser", "var_name": "parser" }, { "declarator": "VAGRANT_CONFIG = \"Host default\\n\"\n\t\t\t+ \" HostName 127.0.0.1\\n\...
{ "body": "@Test(expected = InvalidSshConfigException.class)\n\tpublic void testThrowsOnMissingUser() {\n\t\tparser.parse(\"HostName 127.0.0.1\\nPort 22\");\n\t}", "class_method_signature": "SshConfigParserTest.testThrowsOnMissingUser()", "constructor": false, "full_signature": "@Test(expected = InvalidSshConfi...
{ "fields": [ { "declarator": "DEFAULT_PORT = 22", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 22;", "type": "int", "var_name": "DEFAULT_PORT" } ], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/com...
{ "body": "public SshConfig parse(String configStr) {\n\t\tMutableSshConfig result = new MutableSshConfig();\n\t\tfor (String line : configStr.split(\"\\n\")) {\n\t\t\tline = line.trim();\n\t\t\tString[] splits = line.split(\"\\\\s\", 2);\n\t\t\tif (splits.length != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString key ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_39
{ "fields": [ { "declarator": "storage", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate FileBasedBlobStorage storage;", "type": "FileBasedBlobStorage", "var_name": "storage" }, { "declarator": "dataDirectory = new TemporaryDirectory()...
{ "body": "@Test\n\tpublic void testDelete() throws Exception {\n\t\tbyte[] data = new byte[] { 4, 5, 6, 7 };\n\t\tString key = \"the-key\";\n\t\tPath blobPath = dataDirectory.resolve(\"blobs\").resolve(key);\n\t\tFiles.createDirectories(blobPath.getParent());\n\t\tFiles.write(blobPath, data);\n\t\tstorage.delete(key...
{ "fields": [ { "declarator": "dataDirectory", "modifier": "@Autowired\n\t@DataDirectory\n\tprivate", "original_string": "@Autowired\n\t@DataDirectory\n\tprivate Path dataDirectory;", "type": "Path", "var_name": "dataDirectory" } ], "file": "bugminer-server/src/main/java/de/u...
{ "body": "@Override\n\tpublic void delete(String key) throws BlobNotFoundException, IOException {\n\t\tPath fileName = getFileName(key);\n\t\tif (!Files.exists(fileName)) {\n\t\t\tthrow new BlobNotFoundException(String.format(\n\t\t\t\t\t\"There is no blob with the key %s\", key));\n\t\t}\n\t\tFiles.delete(fileName)...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_1
{ "fields": [ { "declarator": "client", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "tempDir = new TemporaryDirectory()", "modifier": "@Rule\n\tpublic", ...
{ "body": "@Test\n\tpublic void testStartShell() throws IOException {\n\t\tSshConfig config = new SshConfig(\"localhost\", \"me\");\n\t\tSession session = mock(Session.class);\n\t\twhen(client.startSession()).thenReturn(session);\n\t\tShell shell = mock(Shell.class);\n\t\twhen(session.startShell()).thenReturn(shell);...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "config", "modifier": "private final", "original_string": "private final S...
{ "body": "public InteractiveSession startShell() throws IOException {\n\t\tSession session = client.startSession();\n\t\tsession.allocateDefaultPTY();\n\t\tShell shell = session.startShell();\n\t\treturn new ShellSession(shell);\n\t}", "class_method_signature": "SshConnection.startShell()", "constructor": false,...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_0
{ "fields": [ { "declarator": "client", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "tempDir = new TemporaryDirectory()", "modifier": "@Rule\n\tpublic", ...
{ "body": "@Test\n\tpublic void tetsClosesClient() throws IOException {\n\t\tSshConfig config = new SshConfig(\"localhost\", \"me\");\n\t\twhen(client.isConnected()).thenReturn(true);\n\t\tnew SshConnection(config, client).close();\n\t\tverify(client).close();\n\t}", "class_method_signature": "SshConnectionTest.tet...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "config", "modifier": "private final", "original_string": "private final S...
{ "body": "@Override\n\tpublic void close() throws IOException {\n\t\tif (client.isConnected()) {\n\t\t\tclient.close();\n\t\t}\n\t}", "class_method_signature": "SshConnection.close()", "constructor": false, "full_signature": "@Override public void close()", "identifier": "close", "invocations": [ "isCo...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_38
{ "fields": [ { "declarator": "storage", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate FileBasedBlobStorage storage;", "type": "FileBasedBlobStorage", "var_name": "storage" }, { "declarator": "dataDirectory = new TemporaryDirectory()...
{ "body": "@Test\n\tpublic void testGetBytes() throws Exception {\n\t\tbyte[] data = new byte[] { 4, 5, 6, 7 };\n\t\tString key = \"the-key\";\n\t\tPath blobPath = dataDirectory.resolve(\"blobs\").resolve(key);\n\t\tFiles.createDirectories(blobPath.getParent());\n\t\tFiles.write(blobPath, data);\n\t\tbyte[] actualDat...
{ "fields": [ { "declarator": "dataDirectory", "modifier": "@Autowired\n\t@DataDirectory\n\tprivate", "original_string": "@Autowired\n\t@DataDirectory\n\tprivate Path dataDirectory;", "type": "Path", "var_name": "dataDirectory" } ], "file": "bugminer-server/src/main/java/de/u...
{ "body": "@Override\n\tpublic byte[] getBytes(String key) throws BlobNotFoundException, IOException {\n\t\tPath fileName = getFileName(key);\n\t\tif (!Files.exists(fileName)) {\n\t\t\tthrow new BlobNotFoundException(String.format(\n\t\t\t\t\t\"There is no blob with the key %s\", key));\n\t\t}\n\t\treturn Files.readA...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_14
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tSshConfigParser parser;", "type": "SshConfigParser", "var_name": "parser" }, { "declarator": "VAGRANT_CONFIG = \"Host default\\n\"\n\t\t\t+ \" HostName 127.0.0.1\\n\...
{ "body": "@Test(expected = InvalidSshConfigException.class)\n\tpublic void testThrowsOnMissingHost() {\n\t\tparser.parse(\"User me\\nPort 22\");\n\t}", "class_method_signature": "SshConfigParserTest.testThrowsOnMissingHost()", "constructor": false, "full_signature": "@Test(expected = InvalidSshConfigException....
{ "fields": [ { "declarator": "DEFAULT_PORT = 22", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 22;", "type": "int", "var_name": "DEFAULT_PORT" } ], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/com...
{ "body": "public SshConfig parse(String configStr) {\n\t\tMutableSshConfig result = new MutableSshConfig();\n\t\tfor (String line : configStr.split(\"\\n\")) {\n\t\t\tline = line.trim();\n\t\t\tString[] splits = line.split(\"\\\\s\", 2);\n\t\t\tif (splits.length != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString key ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_43
{ "fields": [ { "declarator": "remoteGitHelper", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate RemoteGitHelper remoteGitHelper;", "type": "RemoteGitHelper", "var_name": "remoteGitHelper" }, { "declarator": "connection", "modifi...
{ "body": "@Test\n\tpublic void testIsGitInstalled() throws IOException {\n\t\twhen(connection.tryExecute(\"which\", \"git\")).thenReturn(\n\t\t\t\tnew ExecutionResult(0, \"\", \"\"));\n\t\tassertThat(remoteGitHelper.isGitInstalled(connection), is(true));\n\t}", "class_method_signature": "RemoteGitHelperTest.testIs...
{ "fields": [], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/scm/git/RemoteGitHelper.java", "identifier": "RemoteGitHelper", "interfaces": "", "methods": [ { "class_method_signature": "RemoteGitHelper.RemoteGitHelper()", "constructor": true, "full_signature": ...
{ "body": "public boolean isGitInstalled(SshConnection connection) throws IOException {\n\t\tExecutionResult result = connection.tryExecute(\"which\", \"git\");\n\t\tif (result.getExitCode() == 0) {\n\t\t\treturn true;\n\t\t}\n\t\tif (result.getExitCode() == 1) {\n\t\t\treturn false;\n\t\t}\n\t\tthrow new ProgramExec...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_22
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@Test\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void testIsNotAvailable() throws IOException {\n\t\twhen(executor.execute(\"vagrant\", \"global-status\")).thenThrow(IOException.class);\n\t\tassertThat(strategy.isAvailable(), is(false));\n\t}", "class_method_signature": "VagrantStrategyTest.testIsNotA...
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "@Override\n\tpublic boolean isAvailable() {\n\t\ttry {\n\t\t\texecutor.execute(\"vagrant\", \"global-status\");\n\t\t\treturn true;\n\t\t} catch (IOException e) {\n\t\t\tlogger.debug(\"Vagrant is not available\", e);\n\t\t\treturn false;\n\t\t}\n\t}", "class_method_signature": "VagrantStrategy.isAvailabl...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_34
{ "fields": [ { "declarator": "taskIsRun = false", "modifier": "private", "original_string": "private boolean taskIsRun = false;", "type": "boolean", "var_name": "taskIsRun" }, { "declarator": "taskStateWhenRunWasCalled", "modifier": "private", "original_str...
{ "body": "@Test\n\tpublic void testMarkAsScheduled() {\n\t\tTask task = new SimpleTask(\"Test Task\", c -> {});\n\t\ttask.markAsScheduled();\n\t\tassertThat(task.getState(), is(TaskState.SCHEDULED));\n\t}", "class_method_signature": "TaskTest.testMarkAsScheduled()", "constructor": false, "full_signature": "@Te...
{ "fields": [ { "declarator": "title", "modifier": "private", "original_string": "private String title;", "type": "String", "var_name": "title" }, { "declarator": "context = new TaskContext()", "modifier": "@JsonIgnore\n\tprivate", "original_string": "@JsonI...
{ "body": "public void markAsScheduled() {\n\t\tif (state != TaskState.INITIALIZING && state != TaskState.SCHEDULED) {\n\t\t\tthrow new IllegalStateException(\"Only valid if in INITIALIZING state, but is \" + state);\n\t\t}\n\t\tstate = TaskState.SCHEDULED;\n\t}", "class_method_signature": "Task.markAsScheduled()",...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_18
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStatusParser parser;", "type": "VagrantStatusParser", "var_name": "parser" }, { "declarator": "OUTPUT = \"Current machine states:%n%n\"\n\t\t\t+ \"default ...
{ "body": "@Test\n\tpublic void testParser() {\n\t\tassertThat(parser.parseStatusOutput(String.format(OUTPUT, \"running\")),\n\t\t\t\tis(NodeStatus.ONLINE));\n\t\tassertThat(parser.parseStatusOutput(String.format(OUTPUT, \"not created\")),\n\t\t\t\tis(NodeStatus.OFFLINE));\n\t\tassertThat(parser.parseStatusOutput(\"w...
{ "fields": [ { "declarator": "STATUS_LINE_PATTERN = \"\\\\s*([\\\\S]+)\\\\s+([^\\\\)]+)\\\\s*\\\\(.*\"", "modifier": "private static final", "original_string": "private static final String STATUS_LINE_PATTERN = \"\\\\s*([\\\\S]+)\\\\s+([^\\\\)]+)\\\\s*\\\\(.*\";", "type": "String", ...
{ "body": "public NodeStatus parseStatusOutput(String output) {\n\t\tString[] lines = output.split(\"\\\\r?\\\\n\");\n\t\tboolean isStatus = false;\n\t\tfor (String line : lines) {\n\t\t\tif (line.contains(\"Current machine states:\")) {\n\t\t\t\tisStatus = true;\n\t\t\t} else if (isStatus) {\n\t\t\t\tMatcher matcher...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_21
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@SuppressWarnings(\"unchecked\")\n\t@Test(expected = UnsupportedOperationException.class)\n\tpublic void testIsAvailableDoesNotSwallowRuntimeExceptions() throws IOException {\n\t\twhen(executor.execute(\"vagrant\", \"global-status\"))\n\t\t\t\t.thenThrow(UnsupportedOperationException.class);\n\t\tstrategy....
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "@Override\n\tpublic boolean isAvailable() {\n\t\ttry {\n\t\t\texecutor.execute(\"vagrant\", \"global-status\");\n\t\t\treturn true;\n\t\t} catch (IOException e) {\n\t\t\tlogger.debug(\"Vagrant is not available\", e);\n\t\t\treturn false;\n\t\t}\n\t}", "class_method_signature": "VagrantStrategy.isAvailabl...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_37
{ "fields": [ { "declarator": "storage", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate FileBasedBlobStorage storage;", "type": "FileBasedBlobStorage", "var_name": "storage" }, { "declarator": "dataDirectory = new TemporaryDirectory()...
{ "body": "@Test\n\tpublic void testPutBytes() throws Exception {\n\t\tbyte[] data = new byte[] { 1, 2, 3 };\n\t\tString key = storage.put(data);\n\t\tPath blobPath = dataDirectory.resolve(\"blobs\").resolve(key);\n\t\tassertTrue(\"Blob file \" + blobPath + \" does not exist\", Files.exists(blobPath)) ;\n\t\tbyte[] a...
{ "fields": [ { "declarator": "dataDirectory", "modifier": "@Autowired\n\t@DataDirectory\n\tprivate", "original_string": "@Autowired\n\t@DataDirectory\n\tprivate Path dataDirectory;", "type": "Path", "var_name": "dataDirectory" } ], "file": "bugminer-server/src/main/java/de/u...
{ "body": "@Override\n\tpublic String put(byte[] data) throws IOException {\n\t\tFiles.createDirectories(getRoot());\n\t\tString key = createNewKey();\n\t\tFiles.write(getFileName(key), data);\n\t\treturn key;\n\t}", "class_method_signature": "FileBasedBlobStorage.put(byte[] data)", "constructor": false, "full_...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_3
{ "fields": [ { "declarator": "client", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "tempDir = new TemporaryDirectory()", "modifier": "@Rule\n\tpublic", ...
{ "body": "@SuppressWarnings(\"resource\")\n\t@Test\n\tpublic void testTryExecuteWithDirectory() throws IOException {\n\t\tSession session = mock(Session.class);\n\t\twhen(client.startSession()).thenReturn(session);\n\t\tCommand command = mock(Command.class);\n\t\twhen(session.exec(\"\\\"cd\\\" \\\"/test/dir\\\" && \...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "config", "modifier": "private final", "original_string": "private final S...
{ "body": "@Override\n\tpublic ExecutionResult tryExecute(Path workingDirectory, String... cmd) throws IOException {\n\t\tString workdir = workingDirectory == null ? null : workingDirectory.toString();\n\t\treturn tryExecuteIn(workdir, cmd);\n\t}", "class_method_signature": "SshConnection.tryExecute(Path workingDir...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_17
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tSshConfigParser parser;", "type": "SshConfigParser", "var_name": "parser" }, { "declarator": "VAGRANT_CONFIG = \"Host default\\n\"\n\t\t\t+ \" HostName 127.0.0.1\\n\...
{ "body": "@Test(expected = InvalidSshConfigException.class)\n\tpublic void testThrowsOnInvalidPath() {\n\t\tassumeTrue(\"Test for invalid unix path\", SystemUtils.IS_OS_UNIX);\n\t\tparser.parse(\"HostName 127.0.0.1\\nUser me\\nPort 22\\nIdentityFile d/test\\u0000/d\");\n\t}", "class_method_signature": "SshConfigPa...
{ "fields": [ { "declarator": "DEFAULT_PORT = 22", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 22;", "type": "int", "var_name": "DEFAULT_PORT" } ], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/com...
{ "body": "public SshConfig parse(String configStr) {\n\t\tMutableSshConfig result = new MutableSshConfig();\n\t\tfor (String line : configStr.split(\"\\n\")) {\n\t\t\tline = line.trim();\n\t\t\tString[] splits = line.split(\"\\\\s\", 2);\n\t\t\tif (splits.length != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString key ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_40
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate GitStrategy strategy;", "type": "GitStrategy", "var_name": "strategy" }, { "declarator": "gitFactory", "modifier": "@Mock\n\tprivate", ...
{ "body": "@Test\n\tpublic void testPushToInstallsGit() throws IOException {\n\t\tstrategy.pushTo(repo, nodeConnection, REMOTE_PATH, revision);\n\t\tverify(remoteGitHelper).installGit(sshConnection, VagrantTestData.SPEC);\n\t}", "class_method_signature": "GitStrategyTest.testPushToInstallsGit()", "constructor": f...
{ "fields": [ { "declarator": "gitFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate GitFactory gitFactory;", "type": "GitFactory", "var_name": "gitFactory" }, { "declarator": "dataDir", "modifier": "@Autowired\n\t@DataDirecto...
{ "body": "@Override\n\tpublic void pushTo(CodeRepo repo, NodeConnection node, String remotePath, CodeRevision revision)\n\t\t\tthrows IOException {\n\t\tinitRepository(node, remotePath);\n\n\t\tGit git = open(repo);\n\t\tRefSpec refspec = new RefSpec()\n\t\t\t\t.setSource(revision.getCommitId())\n\t\t\t\t.setDestina...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_41
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate GitStrategy strategy;", "type": "GitStrategy", "var_name": "strategy" }, { "declarator": "gitFactory", "modifier": "@Mock\n\tprivate", ...
{ "body": "@Test\n\tpublic void testPushToPushesRevision() throws IOException, GitAPIException {\n\t\tstrategy.pushTo(repo, nodeConnection, REMOTE_PATH, revision);\n\t\tverify(pushCommand).setRefSpecs(new RefSpec()\n\t\t\t\t.setSource(REVISION)\n\t\t\t\t.setDestination(\"refs/commits/\" + REVISION));\n\t\tverify(push...
{ "fields": [ { "declarator": "gitFactory", "modifier": "@Autowired\n\tprivate", "original_string": "@Autowired\n\tprivate GitFactory gitFactory;", "type": "GitFactory", "var_name": "gitFactory" }, { "declarator": "dataDir", "modifier": "@Autowired\n\t@DataDirecto...
{ "body": "@Override\n\tpublic void pushTo(CodeRepo repo, NodeConnection node, String remotePath, CodeRevision revision)\n\t\t\tthrows IOException {\n\t\tinitRepository(node, remotePath);\n\n\t\tGit git = open(repo);\n\t\tRefSpec refspec = new RefSpec()\n\t\t\t\t.setSource(revision.getCommitId())\n\t\t\t\t.setDestina...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_16
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tSshConfigParser parser;", "type": "SshConfigParser", "var_name": "parser" }, { "declarator": "VAGRANT_CONFIG = \"Host default\\n\"\n\t\t\t+ \" HostName 127.0.0.1\\n\...
{ "body": "@Test(expected = InvalidSshConfigException.class)\n\tpublic void testThrowsOnInvalidPort() {\n\t\tparser.parse(\"HostName 127.0.0.1\\nUser me\\nPort abc\");\n\t}", "class_method_signature": "SshConfigParserTest.testThrowsOnInvalidPort()", "constructor": false, "full_signature": "@Test(expected = Inva...
{ "fields": [ { "declarator": "DEFAULT_PORT = 22", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 22;", "type": "int", "var_name": "DEFAULT_PORT" } ], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/com...
{ "body": "public SshConfig parse(String configStr) {\n\t\tMutableSshConfig result = new MutableSshConfig();\n\t\tfor (String line : configStr.split(\"\\n\")) {\n\t\t\tline = line.trim();\n\t\t\tString[] splits = line.split(\"\\\\s\", 2);\n\t\t\tif (splits.length != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString key ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_2
{ "fields": [ { "declarator": "client", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "tempDir = new TemporaryDirectory()", "modifier": "@Rule\n\tpublic", ...
{ "body": "@Test\n\tpublic void testTryExecute() throws IOException {\n\t\tSshConfig config = new SshConfig(\"localhost\", \"me\");\n\t\tSession session = mock(Session.class);\n\t\twhen(client.startSession()).thenReturn(session);\n\t\tCommand command = mock(Command.class);\n\t\twhen(session.exec(\"\\\"test command\\\...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "config", "modifier": "private final", "original_string": "private final S...
{ "body": "@Override\n\tpublic ExecutionResult tryExecute(Path workingDirectory, String... cmd) throws IOException {\n\t\tString workdir = workingDirectory == null ? null : workingDirectory.toString();\n\t\treturn tryExecuteIn(workdir, cmd);\n\t}", "class_method_signature": "SshConnection.tryExecute(Path workingDir...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_36
{ "fields": [ { "declarator": "PROJECT_NAME = \"LANG\"", "modifier": "private static final", "original_string": "private static final String PROJECT_NAME = \"LANG\";", "type": "String", "var_name": "PROJECT_NAME" }, { "declarator": "REPO_URL = \"issues.apache.org/jira/b...
{ "body": "@Test\n\tpublic void testFetch() throws IOException {\n\n\t\tJiraRestClient client = mock(JiraRestClient.class);\n\t\tSearchRestClient searchClient = mock(SearchRestClient.class);\n\t\tSearchResult searchResult = mock(SearchResult.class);\n\n\t\twhen(factory.create(eq(URI.create(API_URL)),\n\t\t\t\torg.moc...
{ "fields": [ { "declarator": "logger = Logger.getLogger(JiraIssueTrackerStrategy.class)", "modifier": "", "original_string": "Logger logger = Logger.getLogger(JiraIssueTrackerStrategy.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "numberOfIssuesFe...
{ "body": "@Override\n\tpublic Collection<Bug> fetch(IssueTracker issueTracker) throws IOException {\n\t\tCollection<Issue> issues = fetchIssues(issueTracker);\n\t\tCollection<Bug> fetchedBugs = createBugs(issueTracker, issues);\n\n\t\treturn fetchedBugs;\n\t}", "class_method_signature": "JiraIssueTrackerStrategy.f...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_20
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@Test\n\tpublic void testIsAvailable() throws IOException {\n\t\twhen(executor.execute(\"vagrant\", \"global-status\"))\n\t\t\t\t.thenReturn(new ExecutionResult(0, \"ok\", \"\"));\n\t\tassertThat(strategy.isAvailable(), is(true));\n\t}", "class_method_signature": "VagrantStrategyTest.testIsAvailable()", ...
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "@Override\n\tpublic boolean isAvailable() {\n\t\ttry {\n\t\t\texecutor.execute(\"vagrant\", \"global-status\");\n\t\t\treturn true;\n\t\t} catch (IOException e) {\n\t\t\tlogger.debug(\"Vagrant is not available\", e);\n\t\t\treturn false;\n\t\t}\n\t}", "class_method_signature": "VagrantStrategy.isAvailabl...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_5
{ "fields": [ { "declarator": "client", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "tempDir = new TemporaryDirectory()", "modifier": "@Rule\n\tpublic", ...
{ "body": "@SuppressWarnings(\"resource\")\n\t@Test(expected = IOException.class)\n\tpublic void testTryExecuteThrowsWhenExitCodeNotRetrieved() throws IOException {\n\t\tSession session = mock(Session.class);\n\t\twhen(client.startSession()).thenReturn(session);\n\t\tCommand command = mock(Command.class);\n\t\twhen(s...
{ "fields": [ { "declarator": "client", "modifier": "private final", "original_string": "private final SSHClient client;", "type": "SSHClient", "var_name": "client" }, { "declarator": "config", "modifier": "private final", "original_string": "private final S...
{ "body": "@Override\n\tpublic ExecutionResult tryExecute(Path workingDirectory, String... cmd) throws IOException {\n\t\tString workdir = workingDirectory == null ? null : workingDirectory.toString();\n\t\treturn tryExecuteIn(workdir, cmd);\n\t}", "class_method_signature": "SshConnection.tryExecute(Path workingDir...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_11
{ "fields": [ { "declarator": "parser", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tSshConfigParser parser;", "type": "SshConfigParser", "var_name": "parser" }, { "declarator": "VAGRANT_CONFIG = \"Host default\\n\"\n\t\t\t+ \" HostName 127.0.0.1\\n\...
{ "body": "@Test\n\tpublic void testPassword() {\n\t\tSshConfig config = parser.parse(PASSWORD_CONFIG);\n\t\tassertThat(config.getPassword(), is(\"abc\"));\n\t}", "class_method_signature": "SshConfigParserTest.testPassword()", "constructor": false, "full_signature": "@Test public void testPassword()", "identi...
{ "fields": [ { "declarator": "DEFAULT_PORT = 22", "modifier": "private static final", "original_string": "private static final int DEFAULT_PORT = 22;", "type": "int", "var_name": "DEFAULT_PORT" } ], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/com...
{ "body": "public SshConfig parse(String configStr) {\n\t\tMutableSshConfig result = new MutableSshConfig();\n\t\tfor (String line : configStr.split(\"\\n\")) {\n\t\t\tline = line.trim();\n\t\t\tString[] splits = line.split(\"\\\\s\", 2);\n\t\t\tif (splits.length != 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString key ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_46
{ "fields": [ { "declarator": "remoteGitHelper", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate RemoteGitHelper remoteGitHelper;", "type": "RemoteGitHelper", "var_name": "remoteGitHelper" }, { "declarator": "connection", "modifi...
{ "body": "@Test\n\tpublic void testInstallGit() throws IOException {\n\t\twhen(connection.tryExecute(\"which\", \"git\"))\n\t\t\t\t.thenReturn(new ExecutionResult(1, \"\", \"\"))\n\t\t\t\t.thenReturn(new ExecutionResult(0, \"\", \"\")); // now it's installed\n\t\tremoteGitHelper.installGit(connection, SystemSpecific...
{ "fields": [], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/scm/git/RemoteGitHelper.java", "identifier": "RemoteGitHelper", "interfaces": "", "methods": [ { "class_method_signature": "RemoteGitHelper.RemoteGitHelper()", "constructor": true, "full_signature": ...
{ "body": "public void installGit(SshConnection connection, SystemSpecification os) throws IOException {\n\t\tif (isGitInstalled(connection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!SystemSpecification.UBUNTU.equals(os.getDistributionName())) {\n\t\t\tthrow new UnsupportedOperationException(\n\t\t\t\t\t\"Only ubuntu is s...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_50
{ "fields": [ { "declarator": "remoteGitHelper", "modifier": "@InjectMocks\n\tprivate", "original_string": "@InjectMocks\n\tprivate RemoteGitHelper remoteGitHelper;", "type": "RemoteGitHelper", "var_name": "remoteGitHelper" }, { "declarator": "connection", "modifi...
{ "body": "@Test\n\tpublic void testInitEmptyRepository() throws Exception {\n\t\tremoteGitHelper.initEmptyRepository(connection, \"remote-path\");\n\t\tverify(connection).execute(\"mkdir\", \"-p\", \"remote-path\");\n\t\tverify(connection).executeIn(\"remote-path\", \"git\", \"init\");\n\t}", "class_method_signatu...
{ "fields": [], "file": "bugminer-server/src/main/java/de/unistuttgart/iste/rss/bugminer/scm/git/RemoteGitHelper.java", "identifier": "RemoteGitHelper", "interfaces": "", "methods": [ { "class_method_signature": "RemoteGitHelper.RemoteGitHelper()", "constructor": true, "full_signature": ...
{ "body": "public void initEmptyRepository(SshConnection connection, String remotePath)\n\t\t\tthrows IOException {\n\t\t// Make the directory if it does not exist. Does not fail if it exists.\n\t\tconnection.execute(\"mkdir\", \"-p\", remotePath);\n\n\t\t// Executing git init in an existing repository is safe (see m...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_9
{ "fields": [], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/LocalCommandExecutorTest.java", "identifier": "LocalCommandExecutorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IOException.class)\n\tpublic void testTryExecuteThrowsOnNonExistantCommand()\n\t\t\tthrows IOException, InterruptedException {\n\t\tCommandExecutor executor = new LocalCommandExecutor();\n\t\texecutor.tryExecute(\"thisdoesnotexist\");\n\t}", "class_method_signature": "LocalCommandExecuto...
{ "fields": [ { "declarator": "logger = Logger.getLogger(LocalCommandExecutor.class)", "modifier": "private final", "original_string": "private final Logger logger = Logger.getLogger(LocalCommandExecutor.class);", "type": "Logger", "var_name": "logger" } ], "file": "bugminer-...
{ "body": "@Override\n\tpublic ExecutionResult tryExecute(Path workingDirectory, String... cmd) throws IOException {\n\t\tlogger.debug(\"Executing `\" + StringUtils.join(cmd, ' ') + \" in \" + workingDirectory);\n\t\tFile workdir = workingDirectory == null ? null : workingDirectory.toFile();\n\t\tProcess process = Ru...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_27
{ "fields": [ { "declarator": "strategy", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantStrategy strategy;", "type": "VagrantStrategy", "var_name": "strategy" }, { "declarator": "boxes", "modifier": "@Mock", "original_string": "@Mock...
{ "body": "@Test\n\tpublic void testGetNodeStatus() throws IOException {\n\t\tFiles.createDirectories(vagrantPath);\n\t\twhen(executor.execute(vagrantPath, \"vagrant\", \"status\")).thenReturn(\n\t\t\t\tnew ExecutionResult(0, \"status line\", \"\"));\n\t\twhen(statusParser.parseStatusOutput(\"status line\")).thenRetu...
{ "fields": [ { "declarator": "NAME = \"vagrant\"", "modifier": "public static final", "original_string": "public static final String NAME = \"vagrant\";", "type": "String", "var_name": "NAME" }, { "declarator": "dataPath", "modifier": "@Autowired\n\t@DataDirector...
{ "body": "@Override\n\tpublic NodeStatus getNodeStatus(Node node) throws IOException {\n\t\tPath nodePath = getPath(node);\n\t\tif (!Files.exists(nodePath)) {\n\t\t\treturn NodeStatus.OFFLINE;\n\t\t}\n\t\tString output = executor.execute(nodePath, \"vagrant\", \"status\").getOutput();\n\t\treturn statusParser.parseS...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }
45257264_31
{ "fields": [ { "declarator": "boxes", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n\tVagrantBoxes boxes;", "type": "VagrantBoxes", "var_name": "boxes" } ], "file": "bugminer-server/src/test/java/de/unistuttgart/iste/rss/bugminer/computing/vagrant/VagrantBoxe...
{ "body": "@Test\n\tpublic void testGetSpecification() {\n\t\tassertThat(boxes.getSpecification(\"ubuntu/trusty64\"), is(SystemSpecification.UBUNTU_1404));\n\t}", "class_method_signature": "VagrantBoxesTest.testGetSpecification()", "constructor": false, "full_signature": "@Test public void testGetSpecification(...
{ "fields": [ { "declarator": "BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecification.UBUNTU_1404)", "modifier": "private static final", "original_string": "private static final Map<String, SystemSpecification> BOXES = ImmutableMap.of(\n\t\t\t\"ubuntu/trusty64\", SystemSpecific...
{ "body": "public SystemSpecification getSpecification(String boxName) {\n\t\treturn BOXES.get(boxName);\n\t}", "class_method_signature": "VagrantBoxes.getSpecification(String boxName)", "constructor": false, "full_signature": "public SystemSpecification getSpecification(String boxName)", "identifier": "getSp...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 45257264, "size": 577, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/bugminer/bugminer" }