id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
81143147_71
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/OptionalLazySchemeTest.java", "identifier": "OptionalLazySchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = NoSuchElementException.class)\n public void valueFail3() throws Exception\n {\n new OptionalLazyScheme(new Precoded(\"test@example.com:123\")).value();\n }", "class_method_signature": "OptionalLazySchemeTest.valueFail3()", "constructor": false, "full_signature": "@Tes...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalScheme", "modifier": "private", "original_strin...
{ "body": "@Override\n public Scheme value(Scheme defaultValue)\n {\n return scheme().value(defaultValue);\n }", "class_method_signature": "OptionalLazyScheme.value(Scheme defaultValue)", "constructor": false, "full_signature": "@Override public Scheme value(Scheme defaultValue)", "identifier"...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_26
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() throws Exception\n {\n assertEquals(\"\", new Text(new EncodedPath(new Precoded(\"\"))).toString());\n assertEquals(\"/\", new Text(new EncodedPath(new Precoded(\"/\"))).toString());\n assertEquals(\"abc\", new Text(new EncodedPath(new Precoded(...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Path mDelegate;", "type": "Path", "var_name": "mDelegate" }, { "declarator": "mPath", "modifier": "private", "original_string": "private String mPath;",...
{ "body": "@Override\n public String toString()\n {\n if (mPath == null)\n {\n StringBuilder stringBuilder = new StringBuilder(256);\n boolean first = true;\n for (UriEncoded segment : mDelegate)\n {\n if (first)\n {\n ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_30
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/NormalizedTest.java", "identifier": "NormalizedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsEmpty() throws Exception\n {\n assertTrue(new Normalized(new EncodedPath(new Precoded(\"\"))).isEmpty());\n assertFalse(new Normalized(new EncodedPath(new Precoded(\"/\"))).isEmpty());\n }", "class_method_signature": "NormalizedTest.testIsEmpty()", "cons...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Path mDelegate;", "type": "Path", "var_name": "mDelegate" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/paths/Normalized.java", "identifier": "Normalized", ...
{ "body": "@Override\n public boolean isEmpty()\n {\n return mDelegate.isEmpty();\n }", "class_method_signature": "Normalized.isEmpty()", "constructor": false, "full_signature": "@Override public boolean isEmpty()", "identifier": "isEmpty", "invocations": [ "isEmpty" ], "modifiers": ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_67
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/OptionalLazySchemeTest.java", "identifier": "OptionalLazySchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isPresent() throws Exception\n {\n assertTrue(new OptionalLazyScheme(new Precoded(\"http://example.com\")).isPresent());\n assertTrue(new OptionalLazyScheme(new Precoded(\"http://example.com:123\")).isPresent());\n assertTrue(new OptionalLazyScheme(new Precode...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalScheme", "modifier": "private", "original_strin...
{ "body": "@Override\n public boolean isPresent()\n {\n return scheme().isPresent();\n }", "class_method_signature": "OptionalLazyScheme.isPresent()", "constructor": false, "full_signature": "@Override public boolean isPresent()", "identifier": "isPresent", "invocations": [ "isPresent", ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_48
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/EmptyUriTest.java", "identifier": "EmptyUriTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFragment() throws Exception\n {\n assertFalse(new EmptyUri().fragment().isPresent());\n }", "class_method_signature": "EmptyUriTest.testFragment()", "constructor": false, "full_signature": "@Test public void testFragment()", "identifier": "testFragment", "i...
{ "fields": [ { "declarator": "INSTANCE = new EmptyUri()", "modifier": "public final static", "original_string": "public final static EmptyUri INSTANCE = new EmptyUri();", "type": "EmptyUri", "var_name": "INSTANCE" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/uris...
{ "body": "@Override\n public Optional<? extends Fragment> fragment()\n {\n return absent();\n }", "class_method_signature": "EmptyUri.fragment()", "constructor": false, "full_signature": "@Override public Optional<? extends Fragment> fragment()", "identifier": "fragment", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_72
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/OptionalLazySchemeTest.java", "identifier": "OptionalLazySchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void valueWithDefault() throws Exception\n {\n assertEquals(\"http\", new OptionalLazyScheme(new Precoded(\"http://example.com\")).value(new StringScheme(\"default\")).toString());\n assertEquals(\"http\", new OptionalLazyScheme(new Precoded(\"http://example.com:123\")).v...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalScheme", "modifier": "private", "original_strin...
{ "body": "@Override\n public Scheme value(Scheme defaultValue)\n {\n return scheme().value(defaultValue);\n }", "class_method_signature": "OptionalLazyScheme.value(Scheme defaultValue)", "constructor": false, "full_signature": "@Override public Scheme value(Scheme defaultValue)", "identifier"...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_25
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSubSequence() throws Exception\n {\n assertEquals(\"\", new Text(new EncodedPath(new Precoded(\"\"))).subSequence(0, 0).toString());\n assertEquals(\"/\", new Text(new EncodedPath(new Precoded(\"/\"))).subSequence(0, 1).toString());\n assertEquals(\"b\", n...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Path mDelegate;", "type": "Path", "var_name": "mDelegate" }, { "declarator": "mPath", "modifier": "private", "original_string": "private String mPath;",...
{ "body": "@Override\n public CharSequence subSequence(int beginIndex, int endIndex)\n {\n return toString().subSequence(beginIndex, endIndex);\n }", "class_method_signature": "Text.subSequence(int beginIndex, int endIndex)", "constructor": false, "full_signature": "@Override public CharSequence...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_33
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/ResolvedTest.java", "identifier": "ResolvedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsEmpty() throws Exception\n {\n assertTrue(new Resolved(EmptyPath.INSTANCE, EmptyPath.INSTANCE).isEmpty());\n assertFalse(new Resolved(EmptyPath.INSTANCE, new EncodedPath(new Precoded(\"abc/def\"))).isEmpty());\n assertFalse(new Resolved(new EncodedPath(n...
{ "fields": [ { "declarator": "mBase", "modifier": "private final", "original_string": "private final Path mBase;", "type": "Path", "var_name": "mBase" }, { "declarator": "mReference", "modifier": "private final", "original_string": "private final Path mRefe...
{ "body": "@Override\n public boolean isEmpty()\n {\n return mBase.isEmpty() && mReference.isEmpty();\n }", "class_method_signature": "Resolved.isEmpty()", "constructor": false, "full_signature": "@Override public boolean isEmpty()", "identifier": "isEmpty", "invocations": [ "isEmpty", ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_64
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/StringSchemeTest.java", "identifier": "StringSchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testCharAtIllegalChar() throws Exception\n {\n new StringScheme(\"http_\").charAt(0);\n }", "class_method_signature": "StringSchemeTest.testCharAtIllegalChar()", "constructor": false, "full_signature": "@Test(expected = Il...
{ "fields": [ { "declarator": "mScheme", "modifier": "private final", "original_string": "private final CharSequence mScheme;", "type": "CharSequence", "var_name": "mScheme" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/schemes/StringScheme.java", "identifier": "...
{ "body": "@Override\n public char charAt(int i)\n {\n return mScheme.charAt(i);\n }", "class_method_signature": "StringScheme.charAt(int i)", "constructor": false, "full_signature": "@Override public char charAt(int i)", "identifier": "charAt", "invocations": [ "charAt" ], "modifier...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_8
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/encoding/PrecodedTest.java", "identifier": "PrecodedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHashCode() throws Exception\n {\n\n }", "class_method_signature": "PrecodedTest.testHashCode()", "constructor": false, "full_signature": "@Test public void testHashCode()", "identifier": "testHashCode", "invocations": [], "modifiers": "@Test public", "paramete...
{ "fields": [ { "declarator": "mEncoded", "modifier": "private final", "original_string": "private final CharSequence mEncoded;", "type": "CharSequence", "var_name": "mEncoded" }, { "declarator": "mStart", "modifier": "private final", "original_string": "pri...
{ "body": "@Override\n public int hashCode()\n {\n return normalized().hashCode();\n }", "class_method_signature": "Precoded.hashCode()", "constructor": false, "full_signature": "@Override public int hashCode()", "identifier": "hashCode", "invocations": [ "hashCode", "normalized" ]...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_13
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/encoding/FormEncodedTest.java", "identifier": "FormEncodedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() throws Exception\n {\n assertEquals(\"\", new FormEncoded(\"\").toString());\n assertEquals(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n new FormEncoded(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU...
{ "fields": [ { "declarator": "mPlain", "modifier": "private final", "original_string": "private final CharSequence mPlain;", "type": "CharSequence", "var_name": "mPlain" }, { "declarator": "mCharSet", "modifier": "private final", "original_string": "private...
{ "body": "@Override\n public String toString()\n {\n if (mEncoded == null)\n {\n try\n {\n mEncoded = encoded(mPlain, mCharSet);\n }\n catch (UnsupportedEncodingException e)\n {\n throw new IllegalArgumentExcepti...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_44
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/EmptyUriTest.java", "identifier": "EmptyUriTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testScheme() throws Exception\n {\n assertFalse(new EmptyUri().scheme().isPresent());\n }", "class_method_signature": "EmptyUriTest.testScheme()", "constructor": false, "full_signature": "@Test public void testScheme()", "identifier": "testScheme", "invocations...
{ "fields": [ { "declarator": "INSTANCE = new EmptyUri()", "modifier": "public final static", "original_string": "public final static EmptyUri INSTANCE = new EmptyUri();", "type": "EmptyUri", "var_name": "INSTANCE" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/uris...
{ "body": "@Override\n public Optional<? extends Scheme> scheme()\n {\n return absent();\n }", "class_method_signature": "EmptyUri.scheme()", "constructor": false, "full_signature": "@Override public Optional<? extends Scheme> scheme()", "identifier": "scheme", "invocations": [ "absent" ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_52
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/authorities/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Ignore\n @Test\n public void testCharAt() throws Exception\n {\n }", "class_method_signature": "TextTest.testCharAt()", "constructor": false, "full_signature": "@Ignore @Test public void testCharAt()", "identifier": "testCharAt", "invocations": [], "modifiers": "@Ignore @Test publi...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Authority mDelegate;", "type": "Authority", "var_name": "mDelegate" }, { "declarator": "mText", "modifier": "private", "original_string": "private Strin...
{ "body": "@Override\n public char charAt(int i)\n {\n return toString().charAt(i);\n }", "class_method_signature": "Text.charAt(int i)", "constructor": false, "full_signature": "@Override public char charAt(int i)", "identifier": "charAt", "invocations": [ "charAt", "toString" ], ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_29
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/ExtendedTest.java", "identifier": "ExtendedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void iterator() throws Exception\n {\n assertThat(new Extended(EmptyPath.INSTANCE, EmptyPath.INSTANCE), new IsEmptyIterable<UriEncoded>());\n assertThat(new Extended(EmptyPath.INSTANCE, new EncodedPath(new Precoded(\"/\"))),\n Matchers.contains((UriEncoded)...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Path mDelegate;", "type": "Path", "var_name": "mDelegate" }, { "declarator": "mNewSegments", "modifier": "private final", "original_string": "private fi...
{ "body": "@Override\n public Iterator<UriEncoded> iterator()\n {\n return Collections.unmodifiableList(normalize(new SerialIterator<>(mDelegate.iterator(), mNewSegments.iterator()))).iterator();\n }", "class_method_signature": "Extended.iterator()", "constructor": false, "full_signature": "@Ove...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_68
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/OptionalLazySchemeTest.java", "identifier": "OptionalLazySchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void value() throws Exception\n {\n assertEquals(\"http\", new OptionalLazyScheme(new Precoded(\"http://example.com\")).value().toString());\n assertEquals(\"http\", new OptionalLazyScheme(new Precoded(\"http://example.com:123\")).value().toString());\n assertEqual...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalScheme", "modifier": "private", "original_strin...
{ "body": "@Override\n public Scheme value(Scheme defaultValue)\n {\n return scheme().value(defaultValue);\n }", "class_method_signature": "OptionalLazyScheme.value(Scheme defaultValue)", "constructor": false, "full_signature": "@Override public Scheme value(Scheme defaultValue)", "identifier"...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_4
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/encoding/PrecodedTest.java", "identifier": "PrecodedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void decoded() throws Exception\n {\n\n }", "class_method_signature": "PrecodedTest.decoded()", "constructor": false, "full_signature": "@Test public void decoded()", "identifier": "decoded", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return...
{ "fields": [ { "declarator": "mEncoded", "modifier": "private final", "original_string": "private final CharSequence mEncoded;", "type": "CharSequence", "var_name": "mEncoded" }, { "declarator": "mStart", "modifier": "private final", "original_string": "pri...
{ "body": "@Override\n public CharSequence decoded(String charset) throws UnsupportedEncodingException\n {\n if (\"UTF-8\".equalsIgnoreCase(charset))\n {\n return decoded();\n }\n return decoded(mEncoded, mStart, mEnd, charset);\n }", "class_method_signature": "Precod...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_69
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/OptionalLazySchemeTest.java", "identifier": "OptionalLazySchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = NoSuchElementException.class)\n public void valueFail1() throws Exception\n {\n new OptionalLazyScheme(new Precoded(\"//example.com:123\")).value();\n }", "class_method_signature": "OptionalLazySchemeTest.valueFail1()", "constructor": false, "full_signature": "@Test(e...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalScheme", "modifier": "private", "original_strin...
{ "body": "@Override\n public Scheme value(Scheme defaultValue)\n {\n return scheme().value(defaultValue);\n }", "class_method_signature": "OptionalLazyScheme.value(Scheme defaultValue)", "constructor": false, "full_signature": "@Override public Scheme value(Scheme defaultValue)", "identifier"...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_5
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/encoding/PrecodedTest.java", "identifier": "PrecodedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void length() throws Exception\n {\n\n }", "class_method_signature": "PrecodedTest.length()", "constructor": false, "full_signature": "@Test public void length()", "identifier": "length", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return": "...
{ "fields": [ { "declarator": "mEncoded", "modifier": "private final", "original_string": "private final CharSequence mEncoded;", "type": "CharSequence", "var_name": "mEncoded" }, { "declarator": "mStart", "modifier": "private final", "original_string": "pri...
{ "body": "@Override\n public int length()\n {\n return mEnd - mStart;\n }", "class_method_signature": "Precoded.length()", "constructor": false, "full_signature": "@Override public int length()", "identifier": "length", "invocations": [], "modifiers": "@Override public", "parameters": "...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_28
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/ExtendedTest.java", "identifier": "ExtendedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isAbsolute() throws Exception\n {\n assertFalse(new Extended(EmptyPath.INSTANCE, EmptyPath.INSTANCE).isAbsolute());\n assertFalse(new Extended(EmptyPath.INSTANCE, new EncodedPath(new Precoded(\"abc/def\"))).isAbsolute());\n assertFalse(new Extended(new Encoded...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Path mDelegate;", "type": "Path", "var_name": "mDelegate" }, { "declarator": "mNewSegments", "modifier": "private final", "original_string": "private fi...
{ "body": "@Override\n public boolean isAbsolute()\n {\n return mDelegate.isAbsolute();\n }", "class_method_signature": "Extended.isAbsolute()", "constructor": false, "full_signature": "@Override public boolean isAbsolute()", "identifier": "isAbsolute", "invocations": [ "isAbsolute" ],...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_53
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/authorities/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Ignore\n @Test\n public void testSubSequence() throws Exception\n {\n\n }", "class_method_signature": "TextTest.testSubSequence()", "constructor": false, "full_signature": "@Ignore @Test public void testSubSequence()", "identifier": "testSubSequence", "invocations": [], "modifiers"...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Authority mDelegate;", "type": "Authority", "var_name": "mDelegate" }, { "declarator": "mText", "modifier": "private", "original_string": "private Strin...
{ "body": "@Override\n public UriEncoded subSequence(int startIndex, int endIndex)\n {\n if (startIndex == 0 && endIndex == toString().length())\n {\n return this;\n }\n return new Precoded(toString().subSequence(startIndex, endIndex));\n }", "class_method_signature":...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_45
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/EmptyUriTest.java", "identifier": "EmptyUriTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAuthority() throws Exception\n {\n assertFalse(new EmptyUri().authority().isPresent());\n }", "class_method_signature": "EmptyUriTest.testAuthority()", "constructor": false, "full_signature": "@Test public void testAuthority()", "identifier": "testAuthority",...
{ "fields": [ { "declarator": "INSTANCE = new EmptyUri()", "modifier": "public final static", "original_string": "public final static EmptyUri INSTANCE = new EmptyUri();", "type": "EmptyUri", "var_name": "INSTANCE" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/uris...
{ "body": "@Override\n public Optional<? extends Authority> authority()\n {\n return absent();\n }", "class_method_signature": "EmptyUri.authority()", "constructor": false, "full_signature": "@Override public Optional<? extends Authority> authority()", "identifier": "authority", "invocations...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_12
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/encoding/NormalizedTest.java", "identifier": "NormalizedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() throws Exception\n {\n assertEquals(\"\", new Normalized(new Precoded(\"\")).normalized().toString());\n assertEquals(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n new Precoded(\"0123456789abcdefghijklmnopqrstuvwx...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final UriEncoded mDelegate;", "type": "UriEncoded", "var_name": "mDelegate" }, { "declarator": "mNormalized", "modifier": "private", "original_string": "priva...
{ "body": "@Override\n public String toString()\n {\n if (mNormalized == null)\n {\n mNormalized = normalized(mDelegate);\n }\n return mNormalized.toString();\n }", "class_method_signature": "Normalized.toString()", "constructor": false, "full_signature": "@Overri...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_65
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/StringSchemeTest.java", "identifier": "StringSchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testSubSequenceIllegalChar() throws Exception\n {\n new StringScheme(\"http_\").subSequence(1, 2);\n }", "class_method_signature": "StringSchemeTest.testSubSequenceIllegalChar()", "constructor": false, "full_signature": "@...
{ "fields": [ { "declarator": "mScheme", "modifier": "private final", "original_string": "private final CharSequence mScheme;", "type": "CharSequence", "var_name": "mScheme" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/schemes/StringScheme.java", "identifier": "...
{ "body": "@Override\n public CharSequence subSequence(int i, int i1)\n {\n return mScheme.subSequence(i, i1);\n }", "class_method_signature": "StringScheme.subSequence(int i, int i1)", "constructor": false, "full_signature": "@Override public CharSequence subSequence(int i, int i1)", "identif...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_9
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/encoding/PrecodedTest.java", "identifier": "PrecodedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void equals() throws Exception\n {\n\n }", "class_method_signature": "PrecodedTest.equals()", "constructor": false, "full_signature": "@Test public void equals()", "identifier": "equals", "invocations": [], "modifiers": "@Test public", "parameters": "()", "return": "...
{ "fields": [ { "declarator": "mEncoded", "modifier": "private final", "original_string": "private final CharSequence mEncoded;", "type": "CharSequence", "var_name": "mEncoded" }, { "declarator": "mStart", "modifier": "private final", "original_string": "pri...
{ "body": "@Override\n public boolean equals(Object obj)\n {\n return obj instanceof UriEncoded && normalized().equals(obj);\n }", "class_method_signature": "Precoded.equals(Object obj)", "constructor": false, "full_signature": "@Override public boolean equals(Object obj)", "identifier": "equa...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_32
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/NormalizedTest.java", "identifier": "NormalizedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIterator() throws Exception\n {\n assertThat(new Normalized(EmptyPath.INSTANCE), new IsEmptyIterable());\n assertThat(new Normalized(new EncodedPath(new Precoded(\".\"))), Matchers.contains((UriEncoded) IdempotentEncoded.CURRENT, IdempotentEncoded.EMPTY));\n ...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Path mDelegate;", "type": "Path", "var_name": "mDelegate" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/paths/Normalized.java", "identifier": "Normalized", ...
{ "body": "@Override\n public Iterator<UriEncoded> iterator()\n {\n if (mDelegate.isEmpty())\n {\n // no elements whatsoever\n return EmptyIterator.instance();\n }\n return Collections.unmodifiableList(normalize(mDelegate.iterator())).iterator();\n }", "cla...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_24
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCharAt() throws Exception\n {\n assertEquals('/', new Text(new EncodedPath(new Precoded(\"/\"))).charAt(0));\n assertEquals('a', new Text(new EncodedPath(new Precoded(\"abc\"))).charAt(0));\n assertEquals('b', new Text(new EncodedPath(new Precoded(\"abc\")...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Path mDelegate;", "type": "Path", "var_name": "mDelegate" }, { "declarator": "mPath", "modifier": "private", "original_string": "private String mPath;",...
{ "body": "@Override\n public char charAt(int index)\n {\n return toString().charAt(index);\n }", "class_method_signature": "Text.charAt(int index)", "constructor": false, "full_signature": "@Override public char charAt(int index)", "identifier": "charAt", "invocations": [ "charAt", ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_73
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/SchemesTest.java", "identifier": "SchemesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSchemes()\n {\n assertEquals(\"ftp\", Schemes.FTP.toString());\n assertEquals(\"http\", Schemes.HTTP.toString());\n assertEquals(\"https\", Schemes.HTTPS.toString());\n assertEquals(\"mailto\", Schemes.MAILTO.toString());\n }", "class_method_si...
{ "fields": [ { "declarator": "FTP = new StringScheme(\"ftp\")", "modifier": "public final static", "original_string": "public final static Scheme FTP = new StringScheme(\"ftp\");", "type": "Scheme", "var_name": "FTP" }, { "declarator": "HTTP = new StringScheme(\"http\"...
{ "body": "private Schemes()\n {\n }", "class_method_signature": "Schemes.Schemes()", "constructor": true, "full_signature": "private Schemes()", "identifier": "Schemes", "invocations": [], "modifiers": "private", "parameters": "()", "return": "", "signature": " Schemes()", "testcase": fals...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_49
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/EmptyUriTest.java", "identifier": "EmptyUriTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsHierarchical() throws Exception\n {\n assertFalse(new EmptyUri().isHierarchical());\n }", "class_method_signature": "EmptyUriTest.testIsHierarchical()", "constructor": false, "full_signature": "@Test public void testIsHierarchical()", "identifier": "testIsH...
{ "fields": [ { "declarator": "INSTANCE = new EmptyUri()", "modifier": "public final static", "original_string": "public final static EmptyUri INSTANCE = new EmptyUri();", "type": "EmptyUri", "var_name": "INSTANCE" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/uris...
{ "body": "@Override\n public boolean isHierarchical()\n {\n return false;\n }", "class_method_signature": "EmptyUri.isHierarchical()", "constructor": false, "full_signature": "@Override public boolean isHierarchical()", "identifier": "isHierarchical", "invocations": [], "modifiers": "@Ove...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_15
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/EncodedPathTest.java", "identifier": "EncodedPathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isAbsolute() throws Exception\n {\n assertFalse(new EncodedPath(new Precoded(\"\")).isAbsolute());\n assertFalse(new EncodedPath(new Precoded(\".\")).isAbsolute());\n assertFalse(new EncodedPath(new Precoded(\"./\")).isAbsolute());\n assertFalse(new Enc...
{ "fields": [ { "declarator": "CONVERTER = new AbstractConvertedIterator.Converter<UriEncoded, CharSequence>()\n {\n @Override\n public UriEncoded convert(CharSequence element)\n {\n return new Precoded(element);\n }\n }", "modifier": "private final static"...
{ "body": "@Override\n public boolean isAbsolute()\n {\n return mPath.length() > 0 && mPath.charAt(0) == '/';\n }", "class_method_signature": "EncodedPath.isAbsolute()", "constructor": false, "full_signature": "@Override public boolean isAbsolute()", "identifier": "isAbsolute", "invocations"...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_42
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/LazyUriTest.java", "identifier": "LazyUriTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isAbsolute() throws Exception\n {\n assertFalse(new LazyUri(new Precoded(\"/some/path\")).isAbsolute());\n assertTrue(new LazyUri(new Precoded(\"http://www.example.com/\")).isAbsolute());\n }", "class_method_signature": "LazyUriTest.isAbsolute()", "constructor...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalScheme", "modifier": "private final", "original...
{ "body": "@Override\n public boolean isAbsolute()\n {\n return mOptionalScheme.isPresent();\n }", "class_method_signature": "LazyUri.isAbsolute()", "constructor": false, "full_signature": "@Override public boolean isAbsolute()", "identifier": "isAbsolute", "invocations": [ "isPresent" ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_54
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/authorities/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Ignore\n @Test\n public void testToString() throws Exception\n {\n\n }", "class_method_signature": "TextTest.testToString()", "constructor": false, "full_signature": "@Ignore @Test public void testToString()", "identifier": "testToString", "invocations": [], "modifiers": "@Ignore @...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Authority mDelegate;", "type": "Authority", "var_name": "mDelegate" }, { "declarator": "mText", "modifier": "private", "original_string": "private Strin...
{ "body": "@Override\n public String toString()\n {\n if (mText == null)\n {\n StringBuilder builder = new StringBuilder(64);\n Optional<? extends UriEncoded> mUserInfo = mDelegate.userInfo();\n if (mUserInfo.isPresent())\n {\n builder.app...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_39
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/LazyUriTest.java", "identifier": "LazyUriTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void query() throws Exception\n {\n assertFalse(new LazyUri(new Precoded(\"http://www.example.com\")).query().isPresent());\n assertTrue(new LazyUri(new Precoded(\"http://www.example.com/?\")).query().isPresent());\n assertTrue(new LazyUri(new Precoded(\"http://www...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalScheme", "modifier": "private final", "original...
{ "body": "@Override\n public OptionalLazyQuery query()\n {\n if (mQuery == null)\n {\n mQuery = new OptionalLazyQuery(\n mUriEncoded.subSequence(mOptionalScheme.parsedLength() + authority().parsedLength() + path().parsedLength(), mUriEncoded.length()));\n }\n ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_2
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/encoding/FormPrecodedTest.java", "identifier": "FormPrecodedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void normalized() throws Exception\n {\n assertEquals(\"\", new FormPrecoded(\"\").normalized().toString());\n assertEquals(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n new FormPrecoded(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGH...
{ "fields": [ { "declarator": "mEncoded", "modifier": "private final", "original_string": "private final CharSequence mEncoded;", "type": "CharSequence", "var_name": "mEncoded" }, { "declarator": "mUtf8Plain", "modifier": "private", "original_string": "priva...
{ "body": "@Override\n public UriEncoded normalized()\n {\n if (mNormalized == null)\n {\n mNormalized = new Normalized(this);\n }\n return mNormalized;\n }", "class_method_signature": "FormPrecoded.normalized()", "constructor": false, "full_signature": "@Override...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_19
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/EmptyPathTest.java", "identifier": "EmptyPathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void iterator() throws Exception\n {\n assertFalse(new EmptyPath().iterator().hasNext());\n }", "class_method_signature": "EmptyPathTest.iterator()", "constructor": false, "full_signature": "@Test public void iterator()", "identifier": "iterator", "invocations": [ ...
{ "fields": [ { "declarator": "INSTANCE = new EmptyPath()", "modifier": "public final static", "original_string": "public final static EmptyPath INSTANCE = new EmptyPath();", "type": "EmptyPath", "var_name": "INSTANCE" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/...
{ "body": "@Override\n public Iterator<UriEncoded> iterator()\n {\n return EmptyIterator.instance();\n }", "class_method_signature": "EmptyPath.iterator()", "constructor": false, "full_signature": "@Override public Iterator<UriEncoded> iterator()", "identifier": "iterator", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_58
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/authorities/OptionalLazyAuthorityTest.java", "identifier": "OptionalLazyAuthorityTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testValue() throws Exception\n {\n // check host\n\n assertEquals(\"\", new OptionalLazyAuthority(new Precoded(\"//\")).value().host().toString());\n assertEquals(\"test\", new OptionalLazyAuthority(new Precoded(\"//test\")).value().host().toString());\n ...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalAuthority", "modifier": "private", "original_st...
{ "body": "@Override\n public Authority value(Authority defaultValue)\n {\n return authority().value(defaultValue);\n }", "class_method_signature": "OptionalLazyAuthority.value(Authority defaultValue)", "constructor": false, "full_signature": "@Override public Authority value(Authority defaultVa...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_74
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/parameters/valuetypes/TextValueTypeTest.java", "identifier": "TextValueTypeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testParsedValue() throws Exception\n {\n assertEquals(\"\", TextValueType.INSTANCE.parsedValue(\"\"));\n assertEquals(\"abc\", TextValueType.INSTANCE.parsedValue(\"abc\"));\n }", "class_method_signature": "TextValueTypeTest.testParsedValue()", "constructor": f...
{ "fields": [ { "declarator": "INSTANCE = new TextValueType()", "modifier": "public final static", "original_string": "public final static TextValueType INSTANCE = new TextValueType();", "type": "TextValueType", "var_name": "INSTANCE" } ], "file": "rfc3986-uri/src/main/java/o...
{ "body": "@Override\n public CharSequence parsedValue(CharSequence valueText)\n {\n return valueText;\n }", "class_method_signature": "TextValueType.parsedValue(CharSequence valueText)", "constructor": false, "full_signature": "@Override public CharSequence parsedValue(CharSequence valueText)",...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_23
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLength() throws Exception\n {\n assertEquals(0, new Text(new EncodedPath(new Precoded(\"\"))).length());\n assertEquals(1, new Text(new EncodedPath(new Precoded(\"/\"))).length());\n assertEquals(3, new Text(new EncodedPath(new Precoded(\"abc\"))).length()...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Path mDelegate;", "type": "Path", "var_name": "mDelegate" }, { "declarator": "mPath", "modifier": "private", "original_string": "private String mPath;",...
{ "body": "@Override\n public int length()\n {\n if (mPath == null)\n {\n // we don't have a cached copy of the path, so just sum the length of all segments\n int len = 0;\n for (UriEncoded segment : mDelegate)\n {\n len += segment.length(...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_35
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/ResolvedTest.java", "identifier": "ResolvedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIterator() throws Exception\n {\n assertThat(new Resolved(EmptyPath.INSTANCE, EmptyPath.INSTANCE), new IsEmptyIterable<UriEncoded>());\n assertThat(new Resolved(EmptyPath.INSTANCE, new EncodedPath(new Precoded(\"/\"))),\n Matchers.contains((UriEnco...
{ "fields": [ { "declarator": "mBase", "modifier": "private final", "original_string": "private final Path mBase;", "type": "Path", "var_name": "mBase" }, { "declarator": "mReference", "modifier": "private final", "original_string": "private final Path mRefe...
{ "body": "@Override\n public Iterator<UriEncoded> iterator()\n {\n if (mReference.isEmpty())\n {\n // nothing to add, just normalize this\n return Collections.unmodifiableList(normalize(mBase.iterator())).iterator();\n }\n if (mReference.isAbsolute())\n ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_62
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/StringSchemeTest.java", "identifier": "StringSchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() throws Exception\n {\n assertEquals(\"http\", new StringScheme(\"http\").toString());\n }", "class_method_signature": "StringSchemeTest.testToString()", "constructor": false, "full_signature": "@Test public void testToString()", "identifier": "test...
{ "fields": [ { "declarator": "mScheme", "modifier": "private final", "original_string": "private final CharSequence mScheme;", "type": "CharSequence", "var_name": "mScheme" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/schemes/StringScheme.java", "identifier": "...
{ "body": "@Override\n public String toString()\n {\n return mScheme.toString();\n }", "class_method_signature": "StringScheme.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "toString" ], "modifier...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_63
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/StringSchemeTest.java", "identifier": "StringSchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void testLengthIllegalChar() throws Exception\n {\n new StringScheme(\"http_\").length();\n }", "class_method_signature": "StringSchemeTest.testLengthIllegalChar()", "constructor": false, "full_signature": "@Test(expected = Ill...
{ "fields": [ { "declarator": "mScheme", "modifier": "private final", "original_string": "private final CharSequence mScheme;", "type": "CharSequence", "var_name": "mScheme" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/schemes/StringScheme.java", "identifier": "...
{ "body": "@Override\n public int length()\n {\n return mScheme.length();\n }", "class_method_signature": "StringScheme.length()", "constructor": false, "full_signature": "@Override public int length()", "identifier": "length", "invocations": [ "length" ], "modifiers": "@Override pub...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_34
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/ResolvedTest.java", "identifier": "ResolvedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsAbsolute() throws Exception\n {\n assertFalse(new Resolved(EmptyPath.INSTANCE, EmptyPath.INSTANCE).isAbsolute());\n assertFalse(new Resolved(EmptyPath.INSTANCE, new EncodedPath(new Precoded(\"abc/def\"))).isAbsolute());\n assertFalse(new Resolved(new Enc...
{ "fields": [ { "declarator": "mBase", "modifier": "private final", "original_string": "private final Path mBase;", "type": "Path", "var_name": "mBase" }, { "declarator": "mReference", "modifier": "private final", "original_string": "private final Path mRefe...
{ "body": "@Override\n public boolean isAbsolute()\n {\n return mBase.isAbsolute() || mReference.isAbsolute();\n }", "class_method_signature": "Resolved.isAbsolute()", "constructor": false, "full_signature": "@Override public boolean isAbsolute()", "identifier": "isAbsolute", "invocations": ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_22
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/StructuredPathTest.java", "identifier": "StructuredPathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIterator() throws Exception\n {\n assertThat(new StructuredPath(), new IsEmptyIterable());\n assertThat(new StructuredPath(IdempotentEncoded.EMPTY), Matchers.contains((UriEncoded) IdempotentEncoded.EMPTY));\n assertThat(new StructuredPath(IdempotentEncoded...
{ "fields": [ { "declarator": "mPathSegments", "modifier": "private final", "original_string": "private final UriEncoded[] mPathSegments;", "type": "UriEncoded[]", "var_name": "mPathSegments" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/paths/StructuredPath.java",...
{ "body": "@Override\n public Iterator<UriEncoded> iterator()\n {\n return new ArrayIterator<>(mPathSegments);\n }", "class_method_signature": "StructuredPath.iterator()", "constructor": false, "full_signature": "@Override public Iterator<UriEncoded> iterator()", "identifier": "iterator", "i...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_75
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/parameters/valuetypes/TextValueTypeTest.java", "identifier": "TextValueTypeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSerializedValue() throws Exception\n {\n assertEquals(\"\", TextValueType.INSTANCE.serializedValue(\"\"));\n assertEquals(\"abc\", TextValueType.INSTANCE.serializedValue(\"abc\"));\n }", "class_method_signature": "TextValueTypeTest.testSerializedValue()", ...
{ "fields": [ { "declarator": "INSTANCE = new TextValueType()", "modifier": "public final static", "original_string": "public final static TextValueType INSTANCE = new TextValueType();", "type": "TextValueType", "var_name": "INSTANCE" } ], "file": "rfc3986-uri/src/main/java/o...
{ "body": "@Override\n public CharSequence serializedValue(CharSequence value)\n {\n return value;\n }", "class_method_signature": "TextValueType.serializedValue(CharSequence value)", "constructor": false, "full_signature": "@Override public CharSequence serializedValue(CharSequence value)", "...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_59
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/schemes/StringSchemeTest.java", "identifier": "StringSchemeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLength() throws Exception\n {\n assertEquals(4, new StringScheme(\"http\").length());\n }", "class_method_signature": "StringSchemeTest.testLength()", "constructor": false, "full_signature": "@Test public void testLength()", "identifier": "testLength", "inv...
{ "fields": [ { "declarator": "mScheme", "modifier": "private final", "original_string": "private final CharSequence mScheme;", "type": "CharSequence", "var_name": "mScheme" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/schemes/StringScheme.java", "identifier": "...
{ "body": "@Override\n public int length()\n {\n return mScheme.length();\n }", "class_method_signature": "StringScheme.length()", "constructor": false, "full_signature": "@Override public int length()", "identifier": "length", "invocations": [ "length" ], "modifiers": "@Override pub...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_18
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/EmptyPathTest.java", "identifier": "EmptyPathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isAbsolute() throws Exception\n {\n assertFalse(new EmptyPath().isAbsolute());\n }", "class_method_signature": "EmptyPathTest.isAbsolute()", "constructor": false, "full_signature": "@Test public void isAbsolute()", "identifier": "isAbsolute", "invocations": [ ...
{ "fields": [ { "declarator": "INSTANCE = new EmptyPath()", "modifier": "public final static", "original_string": "public final static EmptyPath INSTANCE = new EmptyPath();", "type": "EmptyPath", "var_name": "INSTANCE" } ], "file": "rfc3986-uri/src/main/java/org/dmfs/rfc3986/...
{ "body": "@Override\n public boolean isAbsolute()\n {\n return false;\n }", "class_method_signature": "EmptyPath.isAbsolute()", "constructor": false, "full_signature": "@Override public boolean isAbsolute()", "identifier": "isAbsolute", "invocations": [], "modifiers": "@Override public", ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_3
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/encoding/FormPrecodedTest.java", "identifier": "FormPrecodedTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() throws Exception\n {\n assertEquals(\"\", new FormPrecoded(\"\").decoded());\n assertEquals(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n new FormPrecoded(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRST...
{ "fields": [ { "declarator": "mEncoded", "modifier": "private final", "original_string": "private final CharSequence mEncoded;", "type": "CharSequence", "var_name": "mEncoded" }, { "declarator": "mUtf8Plain", "modifier": "private", "original_string": "priva...
{ "body": "@Override\n public String toString()\n {\n return mEncoded.toString();\n }", "class_method_signature": "FormPrecoded.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "invocations": [ "toString" ], "modifie...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_38
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/LazyUriTest.java", "identifier": "LazyUriTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPath() throws Exception\n {\n assertTrue(new LazyUri(new Precoded(\"http://www.example.com\")).path().isEmpty());\n assertTrue(new LazyUri(new Precoded(\"http://www.example.com?q=test\")).path().isEmpty());\n assertTrue(new LazyUri(new Precoded(\"http://ww...
{ "fields": [ { "declarator": "mUriEncoded", "modifier": "private final", "original_string": "private final UriEncoded mUriEncoded;", "type": "UriEncoded", "var_name": "mUriEncoded" }, { "declarator": "mOptionalScheme", "modifier": "private final", "original...
{ "body": "@Override\n public LazyPath path()\n {\n if (mPath == null)\n {\n mPath = new LazyPath(mUriEncoded.subSequence(mOptionalScheme.parsedLength() + authority().parsedLength(), mUriEncoded.length()));\n }\n return mPath;\n }", "class_method_signature": "LazyUri....
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_55
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/authorities/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNormalized() throws Exception\n {\n assertEquals(\"user@host:123\", new Text(new StructuredAuthority(new Precoded(\"user\"), new Precoded(\"host\"), 123)).normalized().toString());\n assertEquals(\"user%40host@host:123\",\n new Text(new StructuredA...
{ "fields": [ { "declarator": "mDelegate", "modifier": "private final", "original_string": "private final Authority mDelegate;", "type": "Authority", "var_name": "mDelegate" }, { "declarator": "mText", "modifier": "private", "original_string": "private Strin...
{ "body": "@Override\n public UriEncoded normalized()\n {\n return this;\n }", "class_method_signature": "Text.normalized()", "constructor": false, "full_signature": "@Override public UriEncoded normalized()", "identifier": "normalized", "invocations": [], "modifiers": "@Override public", ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_43
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/TextTest.java", "identifier": "TextTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToString() throws Exception\n {\n assertEquals(\"http://example.com/test?x=y#123\", new Text(\n new StructuredUri(new StringScheme(\"http\"), new EncodedAuthority(new Precoded(\"example.com\")), new EncodedPath(new Precoded(\"/test\")),\n ...
{ "fields": [ { "declarator": "mUri", "modifier": "private final", "original_string": "private final Uri mUri;", "type": "Uri", "var_name": "mUri" }, { "declarator": "mString", "modifier": "private", "original_string": "private String mString;", "type"...
{ "body": "@Override\n public String toString()\n {\n if (mString == null)\n {\n StringBuilder stringBuilder = new StringBuilder(128);\n if (mUri.scheme().isPresent())\n {\n stringBuilder.append(mUri.scheme().value().toString());\n str...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
81143147_14
{ "fields": [], "file": "rfc3986-uri/src/test/java/org/dmfs/rfc3986/paths/EncodedPathTest.java", "identifier": "EncodedPathTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void isEmpty() throws Exception\n {\n assertTrue(new EncodedPath(new Precoded(\"\")).isEmpty());\n assertFalse(new EncodedPath(new Precoded(\".\")).isEmpty());\n assertFalse(new EncodedPath(new Precoded(\"abc\")).isEmpty());\n assertFalse(new EncodedPath(new...
{ "fields": [ { "declarator": "CONVERTER = new AbstractConvertedIterator.Converter<UriEncoded, CharSequence>()\n {\n @Override\n public UriEncoded convert(CharSequence element)\n {\n return new Precoded(element);\n }\n }", "modifier": "private final static"...
{ "body": "@Override\n public boolean isEmpty()\n {\n return mPath.length() == 0;\n }", "class_method_signature": "EncodedPath.isEmpty()", "constructor": false, "full_signature": "@Override public boolean isEmpty()", "identifier": "isEmpty", "invocations": [ "length" ], "modifiers": ...
{ "created": null, "fork": null, "fork_count": 2, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 81143147, "size": 150, "stargazer_count": 9, "stars": null, "updates": null, "url": "https://github.com/dmfs/uri-toolkit" }
80228150_234
{ "fields": [ { "declarator": "encryption", "modifier": "@Mock\n private", "original_string": "@Mock\n private EncryptionApi encryption;", "type": "EncryptionApi", "var_name": "encryption" }, { "declarator": "target", "modifier": "@InjectMocks\n\tprivate", ...
{ "body": "@Test\n\tpublic void testDeleteBackupFiles_withNoArguments_callsDeleteDefaultBackupFiles() {\n\t\t// Arrange.\n\t\tdoCallRealMethod().when(this.target).deleteBackupFiles();\n\n\t\t// Act.\n\t\tthis.target.deleteBackupFiles();\n\n\t\t// Assert.\n\t\tverify(this.target, times(1)).deleteBackupFiles(\"BrokerSe...
{ "fields": [ { "declarator": "encrypter", "modifier": "@Reference", "original_string": "@Reference\n EncryptionApi encrypter;", "type": "EncryptionApi", "var_name": "encrypter" } ], "file": "osc-server/src/main/java/org/osc/core/broker/service/BackupService.java", "iden...
{ "body": "@Override\n public void deleteBackupFiles() {\n \tdeleteBackupFiles(DEFAULT_BACKUP_FILE_NAME);\n }", "class_method_signature": "BackupService.deleteBackupFiles()", "constructor": false, "full_signature": "@Override public void deleteBackupFiles()", "identifier": "deleteBackupFiles", "inv...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_94
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator":...
{ "body": "@Test\n public void testConnection_WithKubernetes_WithIgnoreProviderException_WithIgnoreController_ReturnsSuccessful() throws Exception {\n // Arrange.\n DryRunRequest<VirtualizationConnectorRequest> request = VirtualizationConnectorUtilTestData.generateK8sVCWithSDN();\n\n List<Erro...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(VirtualizationConnectorUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(VirtualizationConnectorUtil.class);", "type": "Logger", "var_name": "LOG...
{ "body": "public <T extends VirtualizationConnectorDto> void checkConnection(DryRunRequest<T> request, VirtualizationConnector vc) throws Exception {\n if (!request.isSkipAllDryRun()) {\n ErrorTypeException errorTypeException = null;\n final ArrayList<CertificateResolverModel> certifica...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_222
{ "fields": [ { "declarator": "em", "modifier": "private", "original_string": "private EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "txControl", "modifier": "@Mock(answer=Answers.CALLS_REAL_METHODS)", "original_string": "@...
{ "body": "@Test\n public void testValidateforCreate_UsingExistingModel_ThrowsVmidcBrokerValidationException() throws Exception {\n // Arrange.\n ApplianceDto dto = new ApplianceDto(EXISTING_MODEL, UUID.randomUUID().toString(), UUID.randomUUID().toString());\n this.exception.expect(VmidcBroker...
{ "fields": [ { "declarator": "em", "modifier": "private", "original_string": "private EntityManager em;", "type": "EntityManager", "var_name": "em" } ], "file": "osc-server/src/main/java/org/osc/core/broker/service/validator/ApplianceDtoValidator.java", "identifier": "Appl...
{ "body": "@Override\n public void validateForCreate(ApplianceDto dto) throws Exception {\n checkForNullFields(dto);\n\n checkFieldLength(dto);\n\n Appliance existingAppliance = ApplianceEntityMgr.findByModel(this.em, dto.getModel());\n\n if (existingAppliance != null) {\n th...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_82
{ "fields": [ { "declarator": "oldProcessId = \"10000\"", "modifier": "private final", "original_string": "private final String oldProcessId = \"10000\";", "type": "String", "var_name": "oldProcessId" }, { "declarator": "linuxProcessExec = \"ps \"", "modifier": "p...
{ "body": "@Test\n public void testGetPidByProcessName_WithImproperData_ReturnsNothing() throws IOException, InterruptedException {\n // Arrange.\n InputStream stubInputStream = IOUtils.toInputStream(\n \" PID TTY STAT TIME COMMAND\\n 9990 ? Ss 0:07 /test/java\\n \" + this.oldProcessId...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ServerUtil.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(ServerUtil.class);", "type": "Logger", "var_name": "log" }, { "declarator":...
{ "body": "public static String getPidByProcessName(String processName) {\n try {\n String psArg = \"\";\n if (isWindows()) {\n psArg += \"-W\";\n }\n\n Process p = java.lang.Runtime.getRuntime().exec(\"ps \" + psArg);\n int exitVal = p.wait...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_127
{ "fields": [ { "declarator": "em", "modifier": "@Mock\n protected", "original_string": "@Mock\n protected EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "tx", "modifier": "@Mock\n protected", "original_string": "@M...
{ "body": "@Test\n public void testExecute_WhenInspectionPortIsRegistered_DAIIsUpdated() throws Exception {\n // Arrange.\n DistributedApplianceInstance dai = createAndRegisterDAI();\n RegisterK8sDAIInspectionPortTask task = this.factory.create(dai);\n\n String inspectionPortId = mockRe...
{ "fields": [ { "declarator": "dai", "modifier": "private", "original_string": "private DistributedApplianceInstance dai;", "type": "DistributedApplianceInstance", "var_name": "dai" }, { "declarator": "apiFactoryService", "modifier": "@Reference\n private", ...
{ "body": "public RegisterK8sDAIInspectionPortTask create(DistributedApplianceInstance dai) {\n RegisterK8sDAIInspectionPortTask task = new RegisterK8sDAIInspectionPortTask();\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil = this.txBroadcastUtil;\n task.apiFa...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_41
{ "fields": [ { "declarator": "FILE_TEXT = \"Some file input.\"", "modifier": "private final static", "original_string": "private final static String FILE_TEXT = \"Some file input.\";", "type": "String", "var_name": "FILE_TEXT" }, { "declarator": "DIR_PATH = System.getP...
{ "body": "@Test\n public void writeInputStreamToFile_fileNotExists_expectedSuccess() throws IOException {\n //Arrange.\n Path file = Paths.get(DIR_PATH + File.separator + FILE_NAME);\n Path backup = Paths.get(DIR_PATH + File.separator + FILE_NAME + \".org\");\n Writer logs = getLogs();...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PKIUtil.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(PKIUtil.class);", "type": "Logger", "var_name": "log" }, { "declarator": "keyA...
{ "body": "public static void writeInputStreamToFile(InputStream is, String parentFolderName, String fileName) {\n\n StringBuilder sb = new StringBuilder(parentFolderName)\n .append(File.separator)\n .append(fileName);\n\n Path file = Paths.get(sb.toString());\n Path...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_170
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UpdatePortGroupHookTask factory;", "type": "UpdatePortGroupHookTask", "var_name": "factory" } ], "file": "osc-server/src/test/java/org/osc/core/broker/service/tasks/conf...
{ "body": "@Test\n public void testExecute_WhenUpdateInspectionHookFails_ThrowsTheUnhandledException() throws Exception {\n // Arrange.\n SecurityGroup sg = newSecurityGroup();\n SecurityGroupInterface sgi = registerNewSGI(sg, 2L);\n DistributedApplianceInstance dai = registerNewDAI();\...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(UpdatePortGroupHookTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(UpdatePortGroupHookTask.class);", "type": "Logger", "var_name": "LOG" },...
{ "body": "public UpdatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai){\n UpdatePortGroupHookTask task = new UpdatePortGroupHookTask(sgi, dai);\n task.apiFactoryService = this.apiFactoryService;\n task.dbConnectionManager = this.dbConnectionManager;\n ...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_16
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator":...
{ "body": "@Test\n public void testIsServiceReady_WhenK8sClientThrowsKubernetesClientException_ThrowsVmidcException() throws Exception {\n // Arrange.\n this.exception.expect(VmidcException.class);\n when(this.fabric8Client.componentstatuses()).thenThrow(new KubernetesClientException(\"\"));\n...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(KubernetesStatusApi.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(KubernetesStatusApi.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "public boolean isServiceReady() throws VmidcException {\n boolean result = false;\n try {\n ComponentStatus status = getKubernetesClient().componentstatuses().withName(K8S_CONTROLLER_COMPONENT_NAME).get();\n if (status == null) {\n LOG.warn(String.format(\...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_166
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n AllocateDAIWithSGIMembersTask factory;", "type": "AllocateDAIWithSGIMembersTask", "var_name": "factory" } ], "file": "osc-server/src/test/java/org/osc/core/broker/servic...
{ "body": "@Test\n public void testExecute_WhenSGIHasNetworkSGMember_AllocatesDAIToVMPort() throws Exception {\n // Arrange.\n SecurityGroup sg = new SecurityGroup(null, null, null);\n sg.addSecurityGroupMember(newSGMWithPort(Network.class, 1L));\n\n SecurityGroupInterface sgi = registe...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(AllocateDAIWithSGIMembersTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(AllocateDAIWithSGIMembersTask.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public AllocateDAIWithSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) {\n AllocateDAIWithSGIMembersTask task = new AllocateDAIWithSGIMembersTask(sgi, dai);\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil =...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_189
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n CreatePortGroupHookTask factory;", "type": "CreatePortGroupHookTask", "var_name": "factory" } ], "file": "osc-server/src/test/java/org/osc/core/broker/service/tasks/conf...
{ "body": "@Test\n public void testExecute_WhenInstallInspectionHookSucceeds_SGIIsUpdatedWithHookId() throws Exception {\n // Arrange.\n SecurityGroup sg = newSecurityGroup();\n SecurityGroupInterface sgi = registerNewSGI(sg, 4L);\n DistributedApplianceInstance dai = registerNewDAI();\n...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(CreatePortGroupHookTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(CreatePortGroupHookTask.class);", "type": "Logger", "var_name": "LOG" },...
{ "body": "@Override\n public CreatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai){\n CreatePortGroupHookTask task = new CreatePortGroupHookTask(sgi, dai);\n\n task.apiFactoryService = this.apiFactoryService;\n task.dbConnectionManager = this.dbConnectio...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_218
{ "fields": [], "file": "osc-server/src/test/java/org/osc/core/broker/service/validator/DistributedApplianceDtoValidatorTest.java", "identifier": "DistributedApplianceDtoValidatorTest", "interfaces": "", "superclass": "extends DistributedApplianceDtoValidatorBaseTest" }
{ "body": "@Test\n @Ignore\n public void testValidateForUpdate_WhenDistributedApplianceExists_ExpectsCorrespondentDa() throws Exception {\n // Arrange.\n DistributedApplianceDto daDto = createDistributedApplianceDto();\n daDto.setId(DA_ID_EXISTING_DA);\n\n // Act.\n Distribute...
{ "fields": [ { "declarator": "em", "modifier": "private", "original_string": "private EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "ENCAPSULATION_TYPE_FIELD = \"Encapsulation Type\"", "modifier": "private final static", "...
{ "body": "@Override\n public DistributedAppliance validateForUpdate(DistributedApplianceDto dto) throws Exception {\n BaseDtoValidator.checkForNullId(dto);\n\n DistributedAppliance da = this.em.find(DistributedAppliance.class, dto.getId());\n\n if (da == null) {\n\n throw new Vmidc...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_131
{ "fields": [ { "declarator": "em", "modifier": "@Mock\n protected", "original_string": "@Mock\n protected EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "tx", "modifier": "@Mock\n protected", "original_string": "@M...
{ "body": "@Test\n public void testExecute_WhenGetDeploymentReturnsExpectedLastAttempt_SucceedsInLastAttempt() throws Exception {\n // Arrange.\n DeploymentSpec ds = createDS();\n when(this.em.find(DeploymentSpec.class, ds.getId())).thenReturn(ds);\n int numberOfRetries = 4;\n in...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(CheckK8sDeploymentStateTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(CheckK8sDeploymentStateTask.class);", "type": "Logger", "var_name": "LOG...
{ "body": "CheckK8sDeploymentStateTask create(DeploymentSpec ds, KubernetesDeploymentApi k8sDeploymentApi) {\n CheckK8sDeploymentStateTask task = new CheckK8sDeploymentStateTask();\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil = this.txBroadcastUtil;\n task....
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_57
{ "fields": [ { "declarator": "unEncryptedMessage = \"helloworld\"", "modifier": "private", "original_string": "private String unEncryptedMessage = \"helloworld\";", "type": "String", "var_name": "unEncryptedMessage" }, { "declarator": "aesCtrEncryptedMessage = \"af5b59...
{ "body": "@Test\n public void testEncryptAESGCM_withEmptyPlainText_encryptionSucceeds() throws EncryptionException {\n // Arrange.\n byte[] plainText = new byte[0];\n\n // Act.\n byte[] encrypted = new EncryptionUtil().encryptAESGCM(plainText, this.key, this.iv, this.aad);\n\n /...
{ "fields": [ { "declarator": "SECURITY_PROPS_RESOURCE_PATH = \"/org/osc/core/broker/util/crypto/security.properties\"", "modifier": "public static final", "original_string": "public static final String SECURITY_PROPS_RESOURCE_PATH = \"/org/osc/core/broker/util/crypto/security.properties\";", ...
{ "body": "@Override\n public byte[] encryptAESGCM(byte[] plainText, SecretKey key, byte[] iv, byte[] aad) throws EncryptionException {\n return new AESGCMEncryption().encrypt(plainText, key, iv, aad);\n }", "class_method_signature": "EncryptionUtil.encryptAESGCM(byte[] plainText, SecretKey key, byte[]...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_20
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator":...
{ "body": "@Test\n public void testIsServiceReady_WhenComponentStatusConditionFalse_ServiceNotReady() throws Exception {\n // Arrange.\n ComponentStatus componentStatus = newComponentStatus(\"Healthy\", \"False\");\n mockComponentStatus(componentStatus);\n\n // Act.\n boolean isS...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(KubernetesStatusApi.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(KubernetesStatusApi.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "public boolean isServiceReady() throws VmidcException {\n boolean result = false;\n try {\n ComponentStatus status = getKubernetesClient().componentstatuses().withName(K8S_CONTROLLER_COMPONENT_NAME).get();\n if (status == null) {\n LOG.warn(String.format(\...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_146
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule public", "original_string": "@Rule public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "em", ...
{ "body": "@Test\n public void testExecuteTransaction_WithImageNotInVS_DeletesAndUpdatesVS() throws Exception {\n //Arrange.\n DeleteImageReferenceTask task = this.factory.create(this.otherImageReference, this.vs);\n\n //Act.\n task.execute();\n\n //Assert.\n Mockito.verif...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(DeleteImageReferenceTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(DeleteImageReferenceTask.class);", "type": "Logger", "var_name": "LOG" ...
{ "body": "public DeleteImageReferenceTask create(OsImageReference imageReference, VirtualSystem vs) {\n DeleteImageReferenceTask task = new DeleteImageReferenceTask();\n task.imageReference = imageReference;\n task.vs = vs;\n task.name = task.getName();\n task.dbConnectionManager =...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_77
{ "fields": [ { "declarator": "networkSettingsApi", "modifier": "private", "original_string": "private NetworkSettingsApi networkSettingsApi;", "type": "NetworkSettingsApi", "var_name": "networkSettingsApi" } ], "file": "osc-server/src/test/java/org/osc/core/broker/util/netwo...
{ "body": "@Test\n public void testGetIPv4LocalNetMask_With_IPCommand_ReturnNetMask() throws IOException\n {\n PowerMockito.mockStatic(ServerUtil.class);\n PowerMockito.when(ServerUtil.execWithLog(Matchers.anyString(), Matchers.anyList())).thenReturn(0);\n String netmask = this.networkSetti...
{ "fields": [ { "declarator": "NETWORK_RESOLV = \"/etc/resolv.conf\"", "modifier": "private final", "original_string": "private final String NETWORK_RESOLV = \"/etc/resolv.conf\";", "type": "String", "var_name": "NETWORK_RESOLV" }, { "declarator": "log = LoggerFactory.g...
{ "body": "String getIPv4LocalNetMask() {\n\n String netMask = \"\";\n String[] cmd = { \"/bin/sh\", \"-c\", \"ip addr show eth0 |grep inet|tr -s ' ' |cut -d' ' -f3\" };\n List<String> outlines = new ArrayList<>();\n\n int exitCode = ServerUtil.execWithLog(cmd, outlines);\n if (exit...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_111
{ "fields": [ { "declarator": "em", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "keyStoreProviderMock", "modifier": "@Mock\n\tprivate", "original_string...
{ "body": "@Test\n public void testIsValidEncryptedBackupFilename_withValidFilename_succeeds() {\n\t\t// Arrange.\n\t\tString givenFilename = \"/example/filename.dbb\";\n\t\t// Act.\n boolean result = this.target.isValidEncryptedBackupFilename(givenFilename);\n\t\t// Assert.\n assertTrue(result);\n ...
{ "fields": [ { "declarator": "DEFAULT_BACKUP_FILE_NAME = \"BrokerServerDBBackup\"", "modifier": "protected static final", "original_string": "protected static final String DEFAULT_BACKUP_FILE_NAME = \"BrokerServerDBBackup\";", "type": "String", "var_name": "DEFAULT_BACKUP_FILE_NAME"...
{ "body": "@Override\n public boolean isValidEncryptedBackupFilename(String filename) {\n \treturn (\".\" + FilenameUtils.getExtension(filename)).equals(EXT_ENCRYPTED_BACKUP);\n }", "class_method_signature": "BackupFileService.isValidEncryptedBackupFilename(String filename)", "constructor": false, "ful...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_98
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator":...
{ "body": "@Test\n public void testConnection_WithOpenStack_WithIgnoreControllerException_WithIgnoreRabbitMqException_WhenKeyStoneListProjectsFail_ReturnsErrorTypeException() throws Exception {\n // Arrange.\n this.exception.expect(ErrorTypeException.class);\n DryRunRequest<VirtualizationConne...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(VirtualizationConnectorUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(VirtualizationConnectorUtil.class);", "type": "Logger", "var_name": "LOG...
{ "body": "public <T extends VirtualizationConnectorDto> void checkConnection(DryRunRequest<T> request, VirtualizationConnector vc) throws Exception {\n if (!request.isSkipAllDryRun()) {\n ErrorTypeException errorTypeException = null;\n final ArrayList<CertificateResolverModel> certifica...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_238
{ "fields": [ { "declarator": "je", "modifier": "", "original_string": "JobEngine je;", "type": "JobEngine", "var_name": "je" }, { "declarator": "tg", "modifier": "", "original_string": "TaskGraph tg;", "type": "TaskGraph", "var_name": "tg" }...
{ "body": "@Test\n public void testConcurrentAppends() throws Exception {\n String jobName = \"Test-Concurrent-Appends\";\n this.tg = new TaskGraph();\n\n for (int i = 0; i < 20; i++) {\n this.tg.addTask(new BaseTask(\"Appender task \" + i) {\n\n @Override\n ...
{ "fields": [ { "declarator": "DEFAULT_JOB_THREAD_POOL_SIZE = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_JOB_THREAD_POOL_SIZE = 10;", "type": "int", "var_name": "DEFAULT_JOB_THREAD_POOL_SIZE" }, { "declarator": "DEFAULT_T...
{ "body": "public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent)\n throws Exception {\n return initJob(name, taskGraph, null, listener, null, persistent);\n }", "class_method_signature": "JobEngine.submit(String name, TaskGraph taskGraph, JobCom...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_61
{ "fields": [ { "declarator": "USER = \"admin\"", "modifier": "private static final", "original_string": "private static final String USER = \"admin\";", "type": "String", "var_name": "USER" }, { "declarator": "PASSWORD = \"admin123\"", "modifier": "private static...
{ "body": "@Test(expected = WebApplicationException.class)\n public void testAuthenticateMissingAuthorization() {\n Mockito.when(this.mockRequest.getHeaderString(\"Authorization\")).thenReturn(null);\n this.authUtil.authenticate(this.mockRequest, USER, ENCRYPTED_PASSWORD);\n }", "class_method_si...
{ "fields": [ { "declarator": "encrypter", "modifier": "@Reference", "original_string": "@Reference\n EncryptionApi encrypter;", "type": "EncryptionApi", "var_name": "encrypter" }, { "declarator": "logging", "modifier": "@Reference", "original_string": "@...
{ "body": "public void authenticate(ContainerRequestContext request, String validUserName, String validPass) {\n authenticate(request, ImmutableMap.of(validUserName, validPass));\n }", "class_method_signature": "AuthUtil.authenticate(ContainerRequestContext request, String validUserName, String validPass)...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_107
{ "fields": [ { "declarator": "em", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "keyStoreProviderMock", "modifier": "@Mock\n\tprivate", "original_string...
{ "body": "@Test\n public void testIsValidBackupFilename_withValidEncryptedBackupFilename_succeeds() {\n\t\t// Arrange.\n\t\tString givenFilename = \"/example/filename.dbb\";\n\t\t// Act.\n boolean result = this.target.isValidBackupFilename(givenFilename);\n\t\t// Assert.\n assertTrue(result);\n }...
{ "fields": [ { "declarator": "DEFAULT_BACKUP_FILE_NAME = \"BrokerServerDBBackup\"", "modifier": "protected static final", "original_string": "protected static final String DEFAULT_BACKUP_FILE_NAME = \"BrokerServerDBBackup\";", "type": "String", "var_name": "DEFAULT_BACKUP_FILE_NAME"...
{ "body": "@Override\n public boolean isValidBackupFilename(String filename) {\n \treturn isValidZipBackupFilename(filename) ||\n \t\t\tisValidEncryptedBackupFilename(filename);\n }", "class_method_signature": "BackupFileService.isValidBackupFilename(String filename)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_36
{ "fields": [ { "declarator": "validDaNames = Lists.newArrayList(\"arv-1\",\"arv-56789-123\")", "modifier": "private static final", "original_string": "private static final List<String> validDaNames = Lists.newArrayList(\"arv-1\",\"arv-56789-123\");", "type": "List<String>", "var_nam...
{ "body": "@Test\n public void testCheckForValidEmailAddress() {\n\n for (String item : validEmails) {\n try {\n ValidateUtil.checkForValidEmailAddress(item);\n } catch (VmidcBrokerInvalidEntryException e) {\n fail(\"Error in checkForValidEmailAddress. \" ...
{ "fields": [ { "declarator": "DEFAULT_MAX_LEN = 155", "modifier": "public static final", "original_string": "public static final int DEFAULT_MAX_LEN = 155;", "type": "int", "var_name": "DEFAULT_MAX_LEN" } ], "file": "osc-server/src/main/java/org/osc/core/broker/util/Validate...
{ "body": "public static void checkForValidEmailAddress(String email) throws VmidcBrokerInvalidEntryException {\n String pattern = \"^([a-zA-Z0-9_\\\\.\\\\-+])+@(([a-zA-Z0-9-])+\\\\.)+([a-zA-Z0-9]{2,4})+$\";\n if (!email.matches(pattern)) {\n throw new VmidcBrokerInvalidEntryException(\"Email...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_150
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule public", "original_string": "@Rule public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "em", ...
{ "body": "@Test\n public void testExecuteTransaction_WithMultipleImages_WithOneApplianceVersionNull_ExpectsUpdate() throws Exception {\n //Arrange.\n OsImageReference imageReference_1 = new OsImageReference(this.vs, \"region\", \"refId1\");\n OsImageReference imageReference_2 = new OsImageRef...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(UpdateVsWithImageVersionTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(UpdateVsWithImageVersionTask.class);", "type": "Logger", "var_name": "L...
{ "body": "public UpdateVsWithImageVersionTask create(VirtualSystem vs) {\n UpdateVsWithImageVersionTask task = new UpdateVsWithImageVersionTask();\n task.vs = vs;\n task.name = task.getName();\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil = this.txBr...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_6
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator":...
{ "body": "@Test\n public void testDeleteDeployment_WhenK8sReturnsDeploymentWithMismatchingId_DoesNothing() throws Exception {\n // Arrange.\n String name = UUID.randomUUID().toString();\n String namespace = UUID.randomUUID().toString();\n mockDeploymentByName(namespace, name, newDeploy...
{ "fields": [ { "declarator": "OSC_DEPLOYMENT_LABEL_NAME = \"osc-deployment\"", "modifier": "public final static", "original_string": "public final static String OSC_DEPLOYMENT_LABEL_NAME = \"osc-deployment\";", "type": "String", "var_name": "OSC_DEPLOYMENT_LABEL_NAME" }, { ...
{ "body": "public void deleteDeployment(String uid, String namespace, String name) throws VmidcException {\n if (uid == null) {\n throw new IllegalArgumentException(\"Uid should not be null\");\n }\n\n if (name == null) {\n throw new IllegalArgumentException(\"Name should no...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_202
{ "fields": [ { "declarator": "OPENSTACK_VMPORT_ID = \"openstack-vmport-id\"", "modifier": "private static final", "original_string": "private static final String OPENSTACK_VMPORT_ID = \"openstack-vmport-id\";", "type": "String", "var_name": "OPENSTACK_VMPORT_ID" }, { "...
{ "body": "@Test\n public void testExecute_CreateInspectionHook_ExpectFailure() throws Exception {\n\n // Arrange\n doThrow(new Exception()).when(this.sdnApi).installInspectionHook(any(), any(), any(), any(), any(), any());\n\n this.exception.expect(Exception.class);\n\n SfcFlowClassifi...
{ "fields": [ { "declarator": "apiFactory", "modifier": "@Reference\n private", "original_string": "@Reference\n private ApiFactoryService apiFactory;", "type": "ApiFactoryService", "var_name": "apiFactory" }, { "declarator": "sfc", "modifier": "private", ...
{ "body": "public SfcFlowClassifierCreateTask create(SecurityGroup securityGroup, VMPort port) {\n SfcFlowClassifierCreateTask task = new SfcFlowClassifierCreateTask();\n\n task.securityGroup = securityGroup;\n task.sfc = securityGroup.getServiceFunctionChain();\n task.port = port;\n ...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_193
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "em...
{ "body": "@Test\n\tpublic void testExecute_WhenDeleteNetworkElementSucceeds_DeleteSFCAndNullsSGNetworkElementId() throws Exception {\n\t\t// Arrange\n\t\tDeleteServiceFunctionChainTask deleteTask = this.task.create(SG_SFC_UNBIND_DELETE_SFC);\n\n\t\tmockDeleteNetworkElement(SG_SFC_UNBIND_DELETE_SFC,\n\t\t\t\tnew Netw...
{ "fields": [ { "declarator": "apiFactory", "modifier": "@Reference\n\tprivate", "original_string": "@Reference\n\tprivate ApiFactoryService apiFactory;", "type": "ApiFactoryService", "var_name": "apiFactory" }, { "declarator": "securityGroup", "modifier": "privat...
{ "body": "public DeleteServiceFunctionChainTask create(SecurityGroup securityGroup) {\n\t\tDeleteServiceFunctionChainTask task = new DeleteServiceFunctionChainTask();\n\n\t\ttask.securityGroup = securityGroup;\n\t\ttask.apiFactory = this.apiFactory;\n\t\ttask.name = task.getName();\n\t\ttask.dbConnectionManager = th...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_185
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n DeallocateDAIOfSGIMembersTask factory;", "type": "DeallocateDAIOfSGIMembersTask", "var_name": "factory" } ], "file": "osc-server/src/test/java/org/osc/core/broker/servic...
{ "body": "@Test\n public void testExecute_WhenSGIHasMultipleSGMembers_DeallocatesDAIsOfVMPorts() throws Exception {\n // Arrange.\n SecurityGroup sg = new SecurityGroup(null, null, null);\n sg.addSecurityGroupMember(newSGMWithPort(VM.class, 1L));\n sg.addSecurityGroupMember(newSGMWithP...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(AllocateDAIWithSGIMembersTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(AllocateDAIWithSGIMembersTask.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) {\n DeallocateDAIOfSGIMembersTask task = new DeallocateDAIOfSGIMembersTask(sgi, dai);\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil =...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_243
{ "fields": [ { "declarator": "je", "modifier": "", "original_string": "JobEngine je;", "type": "JobEngine", "var_name": "je" }, { "declarator": "tg", "modifier": "", "original_string": "TaskGraph tg;", "type": "TaskGraph", "var_name": "tg" }...
{ "body": "@Test\n public void testAddTaskGraph() throws Exception {\n this.A = new EmptyTask(\"TG-A\");\n this.B = new EmptyTask(\"TG-B\");\n this.C = new EmptyTask(\"TG-C\");\n this.D = new EmptyTask(\"TG-D\");\n\n this.tg = new TaskGraph();\n this.tg.addTask(this.A);\n ...
{ "fields": [ { "declarator": "DEFAULT_JOB_THREAD_POOL_SIZE = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_JOB_THREAD_POOL_SIZE = 10;", "type": "int", "var_name": "DEFAULT_JOB_THREAD_POOL_SIZE" }, { "declarator": "DEFAULT_T...
{ "body": "public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent)\n throws Exception {\n return initJob(name, taskGraph, null, listener, null, persistent);\n }", "class_method_signature": "JobEngine.submit(String name, TaskGraph taskGraph, JobCom...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_214
{ "fields": [], "file": "osc-server/src/test/java/org/osc/core/broker/service/validator/DistributedApplianceDtoValidatorTest.java", "identifier": "DistributedApplianceDtoValidatorTest", "interfaces": "", "superclass": "extends DistributedApplianceDtoValidatorBaseTest" }
{ "body": "@Test\n public void testValidateForCreate_WhenDistributedApplianceIsValid_ValidationSucceeds() throws Exception {\n // Arrange.\n DistributedApplianceDto newDaDto= createDistributedApplianceDto();\n newDaDto.setName(DA_NAME_NEW_DA);\n newDaDto.setApplianceId(this.app.getId())...
{ "fields": [ { "declarator": "em", "modifier": "private", "original_string": "private EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "ENCAPSULATION_TYPE_FIELD = \"Encapsulation Type\"", "modifier": "private final static", "...
{ "body": "@Override\n public void validateForCreate(DistributedApplianceDto dto) throws Exception {\n validate(dto);\n\n OSCEntityManager<DistributedAppliance> emgr = new OSCEntityManager<DistributedAppliance>(DistributedAppliance.class,\n this.em, this.txBroadcastUtil);\n\n if...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_215
{ "fields": [], "file": "osc-server/src/test/java/org/osc/core/broker/service/validator/DistributedApplianceDtoValidatorTest.java", "identifier": "DistributedApplianceDtoValidatorTest", "interfaces": "", "superclass": "extends DistributedApplianceDtoValidatorBaseTest" }
{ "body": "@Test\n public void testValidateForUpdate_WithNullDaId_ThrowsInvalidEntryException() throws Exception {\n // Arrange.\n DistributedApplianceDto daDto = createDistributedApplianceDto();\n daDto.setId(null);\n\n this.exception.expect(VmidcBrokerInvalidEntryException.class);\n ...
{ "fields": [ { "declarator": "em", "modifier": "private", "original_string": "private EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "ENCAPSULATION_TYPE_FIELD = \"Encapsulation Type\"", "modifier": "private final static", "...
{ "body": "@Override\n public DistributedAppliance validateForUpdate(DistributedApplianceDto dto) throws Exception {\n BaseDtoValidator.checkForNullId(dto);\n\n DistributedAppliance da = this.em.find(DistributedAppliance.class, dto.getId());\n\n if (da == null) {\n\n throw new Vmidc...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_242
{ "fields": [ { "declarator": "je", "modifier": "", "original_string": "JobEngine je;", "type": "JobEngine", "var_name": "je" }, { "declarator": "tg", "modifier": "", "original_string": "TaskGraph tg;", "type": "TaskGraph", "var_name": "tg" }...
{ "body": "@Test\n public void testJobCompletionListener() throws Exception {\n this.tg.addTask(this.A);\n this.tg.addTask(this.B);\n this.tg.addTask(this.C);\n\n JobCompletionResponder responder = new JobCompletionResponder();\n\n this.job = this.je.submit(\"Job-completion-liste...
{ "fields": [ { "declarator": "DEFAULT_JOB_THREAD_POOL_SIZE = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_JOB_THREAD_POOL_SIZE = 10;", "type": "int", "var_name": "DEFAULT_JOB_THREAD_POOL_SIZE" }, { "declarator": "DEFAULT_T...
{ "body": "public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent)\n throws Exception {\n return initJob(name, taskGraph, null, listener, null, persistent);\n }", "class_method_signature": "JobEngine.submit(String name, TaskGraph taskGraph, JobCom...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_184
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n DeallocateDAIOfSGIMembersTask factory;", "type": "DeallocateDAIOfSGIMembersTask", "var_name": "factory" } ], "file": "osc-server/src/test/java/org/osc/core/broker/servic...
{ "body": "@Test\n public void testExecute_WhenSGIHasSubNetSGMember_DeallocatesDAIsOfVMPort() throws Exception {\n // Arrange.\n SecurityGroup sg = new SecurityGroup(null, null, null);\n sg.addSecurityGroupMember(newSGMWithPort(Subnet.class, 1L));\n\n SecurityGroupInterface sgi = regist...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(AllocateDAIWithSGIMembersTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(AllocateDAIWithSGIMembersTask.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public DeallocateDAIOfSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) {\n DeallocateDAIOfSGIMembersTask task = new DeallocateDAIOfSGIMembersTask(sgi, dai);\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil =...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_192
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n\tpublic", "original_string": "@Rule\n\tpublic ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "em...
{ "body": "@Test\n\tpublic void testExecute_WithSFCBoundAndSGUnbound_NullsSGNetworkElementId() throws Exception {\n\t\t// Arrange.\n\t\tDeleteServiceFunctionChainTask deleteTask = this.task.create(SG_SFC_UNBINDED);\n\n\t\t// Act.\n\t\tdeleteTask.execute();\n\n\t\t// Assert.\n\t\tassertEquals(SecurityGroupEntityMgr.fi...
{ "fields": [ { "declarator": "apiFactory", "modifier": "@Reference\n\tprivate", "original_string": "@Reference\n\tprivate ApiFactoryService apiFactory;", "type": "ApiFactoryService", "var_name": "apiFactory" }, { "declarator": "securityGroup", "modifier": "privat...
{ "body": "public DeleteServiceFunctionChainTask create(SecurityGroup securityGroup) {\n\t\tDeleteServiceFunctionChainTask task = new DeleteServiceFunctionChainTask();\n\n\t\ttask.securityGroup = securityGroup;\n\t\ttask.apiFactory = this.apiFactory;\n\t\ttask.name = task.getName();\n\t\ttask.dbConnectionManager = th...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_203
{ "fields": [ { "declarator": "INSPECTION_HOOK_ID = \"inspection-hook-id\"", "modifier": "private static final", "original_string": "private static final String INSPECTION_HOOK_ID = \"inspection-hook-id\";", "type": "String", "var_name": "INSPECTION_HOOK_ID" }, { "decla...
{ "body": "@Test\n public void testExecute_WithInspectionHook_ExpectUpdate() throws Exception {\n // Arrange\n SfcFlowClassifierDeleteTask deleteTask = this.task.create(this.sg, this.port);\n\n // Act.\n deleteTask.execute();\n\n // Assert\n verify(this.sdnApi, times(1)).r...
{ "fields": [ { "declarator": "apiFactory", "modifier": "@Reference\n private", "original_string": "@Reference\n private ApiFactoryService apiFactory;", "type": "ApiFactoryService", "var_name": "apiFactory" }, { "declarator": "securityGroup", "modifier": "pr...
{ "body": "public SfcFlowClassifierDeleteTask create(SecurityGroup securityGroup, VMPort port) {\n SfcFlowClassifierDeleteTask task = new SfcFlowClassifierDeleteTask();\n\n task.securityGroup = securityGroup;\n task.port = port;\n task.vmName = port.getVm() != null ? port.getVm().getName()...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_7
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator":...
{ "body": "@Test\n public void testDelete_WhenK8sReturnsDeploymentWithMatchingId_ResourceDeleted() throws Exception {\n // Arrange.\n String name = UUID.randomUUID().toString();\n String namespace = UUID.randomUUID().toString();\n String uid = UUID.randomUUID().toString();\n Depl...
{ "fields": [ { "declarator": "OSC_DEPLOYMENT_LABEL_NAME = \"osc-deployment\"", "modifier": "public final static", "original_string": "public final static String OSC_DEPLOYMENT_LABEL_NAME = \"osc-deployment\";", "type": "String", "var_name": "OSC_DEPLOYMENT_LABEL_NAME" }, { ...
{ "body": "public void deleteDeployment(String uid, String namespace, String name) throws VmidcException {\n if (uid == null) {\n throw new IllegalArgumentException(\"Uid should not be null\");\n }\n\n if (name == null) {\n throw new IllegalArgumentException(\"Name should no...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_37
{ "fields": [ { "declarator": "validDaNames = Lists.newArrayList(\"arv-1\",\"arv-56789-123\")", "modifier": "private static final", "original_string": "private static final List<String> validDaNames = Lists.newArrayList(\"arv-1\",\"arv-56789-123\");", "type": "List<String>", "var_nam...
{ "body": "@Test\n public void testCheckForValidIpAddressFormat() {\n for (String item : validIps) {\n try {\n ValidateUtil.checkForValidIpAddressFormat(item);\n } catch (VmidcBrokerInvalidEntryException e) {\n fail(\"Error in checkForValidIpAddressFormat....
{ "fields": [ { "declarator": "DEFAULT_MAX_LEN = 155", "modifier": "public static final", "original_string": "public static final int DEFAULT_MAX_LEN = 155;", "type": "int", "var_name": "DEFAULT_MAX_LEN" } ], "file": "osc-server/src/main/java/org/osc/core/broker/util/Validate...
{ "body": "public static void checkForValidIpAddressFormat(String ipAddress) throws VmidcBrokerInvalidEntryException {\n if (!InetAddresses.isInetAddress(ipAddress)) {\n throw new VmidcBrokerInvalidEntryException(\"IP Address: '\" + ipAddress + \"' has invalid format.\");\n }\n }", "clas...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_151
{ "fields": [ { "declarator": "em", "modifier": "@Mock private", "original_string": "@Mock private EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "glanceMock", "modifier": "@Mock private", "original_string": "@Mock private O...
{ "body": "@Test\n public void testExecuteTransaction_WithVariousVirtualSystems_ExpectsCorrectTaskGraph() throws Exception {\n //Arrange.\n OsImageCheckMetaTask task = new OsImageCheckMetaTask(this.vs, this.region, this.osEndPoint, this.glanceMock);\n task.uploadImageToGlanceTask = new UploadI...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(OsImageCheckMetaTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(OsImageCheckMetaTask.class);", "type": "Logger", "var_name": "LOG" }, {...
{ "body": "@Override\n public void executeTransaction(EntityManager em) throws Exception {\n this.tg = new TaskGraph();\n\n this.vs = em.find(VirtualSystem.class, this.vs.getId());\n\n LOG.info(\"Checking VS \" + this.vs.getName() + \" has the corresponding image uploaded in glance\");\n\n ...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_60
{ "fields": [ { "declarator": "unEncryptedMessage = \"helloworld\"", "modifier": "private", "original_string": "private String unEncryptedMessage = \"helloworld\";", "type": "String", "var_name": "unEncryptedMessage" }, { "declarator": "aesCtrEncryptedMessage = \"af5b59...
{ "body": "@Test\n public void testEncryptAESGCM_withInvalidIVLength_throwsEncryptionException() throws EncryptionException {\n // Arrange.\n byte[] iv = \"123456789\".getBytes(); // length is 9, should be 16\n\n // Assert.\n this.exception.expect(EncryptionException.class);\n\n ...
{ "fields": [ { "declarator": "SECURITY_PROPS_RESOURCE_PATH = \"/org/osc/core/broker/util/crypto/security.properties\"", "modifier": "public static final", "original_string": "public static final String SECURITY_PROPS_RESOURCE_PATH = \"/org/osc/core/broker/util/crypto/security.properties\";", ...
{ "body": "@Override\n public byte[] encryptAESGCM(byte[] plainText, SecretKey key, byte[] iv, byte[] aad) throws EncryptionException {\n return new AESGCMEncryption().encrypt(plainText, key, iv, aad);\n }", "class_method_signature": "EncryptionUtil.encryptAESGCM(byte[] plainText, SecretKey key, byte[]...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_106
{ "fields": [ { "declarator": "em", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "keyStoreProviderMock", "modifier": "@Mock\n\tprivate", "original_string...
{ "body": "@Test\n public void testIsValidBackupFilename_withValidZipBackupFilename_succeeds() {\n\t\t// Arrange.\n\t\tString givenFilename = \"/example/filename.zip\";\n\t\t// Act.\n boolean result = this.target.isValidBackupFilename(givenFilename);\n\t\t// Assert.\n assertTrue(result);\n }", "...
{ "fields": [ { "declarator": "DEFAULT_BACKUP_FILE_NAME = \"BrokerServerDBBackup\"", "modifier": "protected static final", "original_string": "protected static final String DEFAULT_BACKUP_FILE_NAME = \"BrokerServerDBBackup\";", "type": "String", "var_name": "DEFAULT_BACKUP_FILE_NAME"...
{ "body": "@Override\n public boolean isValidBackupFilename(String filename) {\n \treturn isValidZipBackupFilename(filename) ||\n \t\t\tisValidEncryptedBackupFilename(filename);\n }", "class_method_signature": "BackupFileService.isValidBackupFilename(String filename)", "constructor": false, "full_si...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_239
{ "fields": [ { "declarator": "je", "modifier": "", "original_string": "JobEngine je;", "type": "JobEngine", "var_name": "je" }, { "declarator": "tg", "modifier": "", "original_string": "TaskGraph tg;", "type": "TaskGraph", "var_name": "tg" }...
{ "body": "@Test\n public void testTaskConcurrency() throws Exception {\n // Test large volume of job with large number of parallel tasks\n for (int i = 0; i < 100; i++) {\n this.tg = new TaskGraph();\n this.tg.addTask(this.A);\n this.tg.addTask(this.B);\n ...
{ "fields": [ { "declarator": "DEFAULT_JOB_THREAD_POOL_SIZE = 10", "modifier": "public static final", "original_string": "public static final int DEFAULT_JOB_THREAD_POOL_SIZE = 10;", "type": "int", "var_name": "DEFAULT_JOB_THREAD_POOL_SIZE" }, { "declarator": "DEFAULT_T...
{ "body": "public Job submit(String name, TaskGraph taskGraph, JobCompletionListener listener, boolean persistent)\n throws Exception {\n return initJob(name, taskGraph, null, listener, null, persistent);\n }", "class_method_signature": "JobEngine.submit(String name, TaskGraph taskGraph, JobCom...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_76
{ "fields": [ { "declarator": "testFolder = new TemporaryFolder()", "modifier": "@Rule\n public", "original_string": "@Rule\n public TemporaryFolder testFolder = new TemporaryFolder();", "type": "TemporaryFolder", "var_name": "testFolder" }, { "declarator": "excep...
{ "body": "@Test\n public void testLoadProperties_WithUnavailableConfigFile_ThrowsIOException() throws IOException {\n // Arrange.\n File regularFile = new File(this.homeDirectory, this.CONFIG_FILE);\n if(this.regularFile.exists()){\n boolean isDeleted = this.regularFile.delete();\n...
{ "fields": [], "file": "osc-server/src/main/java/org/osc/core/broker/util/FileUtil.java", "identifier": "FileUtil", "interfaces": "", "methods": [ { "class_method_signature": "FileUtil.getFileListFromDirectory(String directory)", "constructor": false, "full_signature": "public static Fi...
{ "body": "public static Properties loadProperties(String propertiesFilePath) throws IOException {\n Properties prop = new Properties();\n try (FileInputStream fileInputStream = new FileInputStream(propertiesFilePath)) {\n prop.load(fileInputStream);\n }\n return prop;\n }", ...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_110
{ "fields": [ { "declarator": "em", "modifier": "@Mock\n\tprivate", "original_string": "@Mock\n\tprivate EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "keyStoreProviderMock", "modifier": "@Mock\n\tprivate", "original_string...
{ "body": "@Test\n public void testIsValidZipBackupFilename_withInvalidFilename_fails() {\n\t\t// Arrange.\n\t\tString givenFilename = \"/example/filename.zip2\";\n\t\t// Act.\n boolean result = this.target.isValidZipBackupFilename(givenFilename);\n\t\t// Assert.\n assertFalse(result);\n }", "cl...
{ "fields": [ { "declarator": "DEFAULT_BACKUP_FILE_NAME = \"BrokerServerDBBackup\"", "modifier": "protected static final", "original_string": "protected static final String DEFAULT_BACKUP_FILE_NAME = \"BrokerServerDBBackup\";", "type": "String", "var_name": "DEFAULT_BACKUP_FILE_NAME"...
{ "body": "@Override\n public boolean isValidZipBackupFilename(String filename) {\n \treturn (\".\" + FilenameUtils.getExtension(filename)).equals(EXT_ZIP_BACKUP);\n }", "class_method_signature": "BackupFileService.isValidZipBackupFilename(String filename)", "constructor": false, "full_signature": "@Ov...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_99
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator":...
{ "body": "@Test\n public void testConnection_WithOpenStack_WithIgnoreControllerException_WithIgnoreRabbitMqException_WhenKeyStoneListProjectsSuccess_ReturnsSuccessful() throws Exception {\n // Arrange.\n DryRunRequest<VirtualizationConnectorRequest> request = VirtualizationConnectorUtilTestData.gene...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(VirtualizationConnectorUtil.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(VirtualizationConnectorUtil.class);", "type": "Logger", "var_name": "LOG...
{ "body": "public <T extends VirtualizationConnectorDto> void checkConnection(DryRunRequest<T> request, VirtualizationConnector vc) throws Exception {\n if (!request.isSkipAllDryRun()) {\n ErrorTypeException errorTypeException = null;\n final ArrayList<CertificateResolverModel> certifica...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_21
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator":...
{ "body": "@Test\n public void testIsServiceReady_WhenComponentStatusConditionTrue_ServiceReady() throws Exception {\n // Arrange.\n ComponentStatus componentStatus = newComponentStatus(\"Healthy\", \"True\");\n mockComponentStatus(componentStatus);\n\n // Act.\n boolean isServic...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(KubernetesStatusApi.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(KubernetesStatusApi.class);", "type": "Logger", "var_name": "LOG" }, { ...
{ "body": "public boolean isServiceReady() throws VmidcException {\n boolean result = false;\n try {\n ComponentStatus status = getKubernetesClient().componentstatuses().withName(K8S_CONTROLLER_COMPONENT_NAME).get();\n if (status == null) {\n LOG.warn(String.format(\...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_147
{ "fields": [ { "declarator": "exception = ExpectedException.none()", "modifier": "@Rule public", "original_string": "@Rule public ExpectedException exception = ExpectedException.none();", "type": "ExpectedException", "var_name": "exception" }, { "declarator": "em", ...
{ "body": "@Test\n public void testExecuteTransaction_WithNoImageReference_ExpectsNoUpdate() throws Exception {\n //Arrange.\n UpdateVsWithImageVersionTask task = this.task.create(this.vs);\n\n //Act.\n task.execute();\n\n //Assert.\n Mockito.verify(this.em, Mockito.never(...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(UpdateVsWithImageVersionTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(UpdateVsWithImageVersionTask.class);", "type": "Logger", "var_name": "L...
{ "body": "public UpdateVsWithImageVersionTask create(VirtualSystem vs) {\n UpdateVsWithImageVersionTask task = new UpdateVsWithImageVersionTask();\n task.vs = vs;\n task.name = task.getName();\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil = this.txBr...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_130
{ "fields": [ { "declarator": "em", "modifier": "@Mock\n protected", "original_string": "@Mock\n protected EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "tx", "modifier": "@Mock\n protected", "original_string": "@M...
{ "body": "@Test\n public void testExecute_WhenGetDeploymentReturnsExpectedCount_SucceedsInFirstAttempt() throws Exception {\n // Arrange.\n DeploymentSpec ds = createDS();\n when(this.em.find(DeploymentSpec.class, ds.getId())).thenReturn(ds);\n\n KubernetesDeployment k8sDeployment = Mo...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(CheckK8sDeploymentStateTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(CheckK8sDeploymentStateTask.class);", "type": "Logger", "var_name": "LOG...
{ "body": "CheckK8sDeploymentStateTask create(DeploymentSpec ds, KubernetesDeploymentApi k8sDeploymentApi) {\n CheckK8sDeploymentStateTask task = new CheckK8sDeploymentStateTask();\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil = this.txBroadcastUtil;\n task....
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_56
{ "fields": [ { "declarator": "unEncryptedMessage = \"helloworld\"", "modifier": "private", "original_string": "private String unEncryptedMessage = \"helloworld\";", "type": "String", "var_name": "unEncryptedMessage" }, { "declarator": "aesCtrEncryptedMessage = \"af5b59...
{ "body": "@Test\n public void testEncryptAESGCM_withNullPlainText_throwsEncryptionException() throws EncryptionException {\n // Arrange.\n byte[] plainText = null;\n\n // Assert.\n this.exception.expect(EncryptionException.class);\n\n // Act.\n new EncryptionUtil().encryp...
{ "fields": [ { "declarator": "SECURITY_PROPS_RESOURCE_PATH = \"/org/osc/core/broker/util/crypto/security.properties\"", "modifier": "public static final", "original_string": "public static final String SECURITY_PROPS_RESOURCE_PATH = \"/org/osc/core/broker/util/crypto/security.properties\";", ...
{ "body": "@Override\n public byte[] encryptAESGCM(byte[] plainText, SecretKey key, byte[] iv, byte[] aad) throws EncryptionException {\n return new AESGCMEncryption().encrypt(plainText, key, iv, aad);\n }", "class_method_signature": "EncryptionUtil.encryptAESGCM(byte[] plainText, SecretKey key, byte[]...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_219
{ "fields": [], "file": "osc-server/src/test/java/org/osc/core/broker/service/validator/DistributedApplianceDtoValidatorTest.java", "identifier": "DistributedApplianceDtoValidatorTest", "interfaces": "", "superclass": "extends DistributedApplianceDtoValidatorBaseTest" }
{ "body": "@Test\n public void testValidateForUpdate_WhenDAUpdateRemovesAssignedVS_ThrowsInvalidEntryException() throws Exception {\n // Arrange.\n DistributedAppliance assignedDA = new DistributedAppliance(this.amc);\n assignedDA.setName(\"DA_WITH_ASSIGNED_VS\");\n assignedDA.setApplia...
{ "fields": [ { "declarator": "em", "modifier": "private", "original_string": "private EntityManager em;", "type": "EntityManager", "var_name": "em" }, { "declarator": "ENCAPSULATION_TYPE_FIELD = \"Encapsulation Type\"", "modifier": "private final static", "...
{ "body": "@Override\n public DistributedAppliance validateForUpdate(DistributedApplianceDto dto) throws Exception {\n BaseDtoValidator.checkForNullId(dto);\n\n DistributedAppliance da = this.em.find(DistributedAppliance.class, dto.getId());\n\n if (da == null) {\n\n throw new Vmidc...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_167
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n AllocateDAIWithSGIMembersTask factory;", "type": "AllocateDAIWithSGIMembersTask", "var_name": "factory" } ], "file": "osc-server/src/test/java/org/osc/core/broker/servic...
{ "body": "@Test\n public void testExecute_WhenSGIHasSubNetSGMember_AllocatesDAIToVMPort() throws Exception {\n // Arrange.\n SecurityGroup sg = new SecurityGroup(null, null, null);\n sg.addSecurityGroupMember(newSGMWithPort(Subnet.class, 1L));\n\n SecurityGroupInterface sgi = registerN...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(AllocateDAIWithSGIMembersTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(AllocateDAIWithSGIMembersTask.class);", "type": "Logger", "var_name": ...
{ "body": "@Override\n public AllocateDAIWithSGIMembersTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai) {\n AllocateDAIWithSGIMembersTask task = new AllocateDAIWithSGIMembersTask(sgi, dai);\n task.dbConnectionManager = this.dbConnectionManager;\n task.txBroadcastUtil =...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }
80228150_188
{ "fields": [ { "declarator": "factory", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n CreatePortGroupHookTask factory;", "type": "CreatePortGroupHookTask", "var_name": "factory" } ], "file": "osc-server/src/test/java/org/osc/core/broker/service/tasks/conf...
{ "body": "@Test\n public void testExecute_WhenInstallInspectionHookFails_ThrowsTheUnhandledException() throws Exception {\n // Arrange.\n SecurityGroup sg = newSecurityGroup();\n SecurityGroupInterface sgi = registerNewSGI(sg, 2L);\n DistributedApplianceInstance dai = registerNewDAI();...
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(CreatePortGroupHookTask.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(CreatePortGroupHookTask.class);", "type": "Logger", "var_name": "LOG" },...
{ "body": "@Override\n public CreatePortGroupHookTask create(SecurityGroupInterface sgi, DistributedApplianceInstance dai){\n CreatePortGroupHookTask task = new CreatePortGroupHookTask(sgi, dai);\n\n task.apiFactoryService = this.apiFactoryService;\n task.dbConnectionManager = this.dbConnectio...
{ "created": null, "fork": null, "fork_count": 25, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 80228150, "size": 202237, "stargazer_count": 36, "stars": null, "updates": null, "url": "https://github.com/opensecuritycontroller/osc-core" }