|
inputs,targets,outputs
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Determine if versions are supported\\\\n *\\\\n * @param requiredVersion The required version, specified as a string. Must not be {@code null}.\\\\n * @param publishedVersion The published version value. Must not be {@code null}.\\\\n *\\\\n * @return {@code true} if, and only if, the request version can be supported\\\\n *\\\\n * @throws IllegalArgumentException if either of the parameters are {@code null}.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testMinorVersionSupported2() throws Exception { VersionMatcher versionMatcher = new VersionMatcher(); Assert.assertFalse(versionMatcher.versionSupported(""1*"", ""2"")); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function that the. |
|
|
|
a code |
|
oke test cases for |
|
|
|
def Example: |
|
ThisYouHello\n This\mine if the with equal byn * |
|
n * |
|
param version_: minimum version number an as a string in\\ be be emptyversioncode i}"" |
|
n""* @param versionAt TheThe latest version of to |
|
be be empty@code null}. |
|
n * @n * @param The@code null} if the as only if the the version contains is be obtained byn * @n * withparamrows ValueArgumentException If the version the input is invalid@code null}\\\\n""*\ |
|
)"". |
|
Function |
|
theUnit test action code |
|
[""Test |
|
|
|
static test_Version()()() throws Exception { |
|
|
|
versioncher. =cher = new VersionMatcher(); |
|
|
|
ert.assertEqu(versionMatcher.is_(""1.2 ""2.); |
|
// |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'/**\\\\n * Compute the <a href=""http://mathworld.wolfram.com/GraphRadius.html"">radius</a> of the graph.\\\\n * The radius of a graph is defined as $\\\\\\\\min_{v\\\\\\\\in V}\\\\\\\\epsilon(v)$, where $\\\\\\\\epsilon(v)$ is the\\\\n * eccentricity of vertex $v$. Two special cases exist. If the graph has no vertices, the radius\\\\n * is 0. If the graph is disconnected, the diameter is {@link Double#POSITIVE_INFINITY}.\\\\n * <p>\\\\n * For more fine-grained control over this method, or if you need additional distance metrics\\\\n * such as the graph diameter, consider using {@link org.jgrapht.alg.shortestpath.GraphMeasurer}\\\\n * instead.\\\\n *\\\\n * @param graph input graph\\\\n * @param <V> graph vertex","@Test public void testGraphRadius() { Graph<Integer, DefaultEdge> g = new SimpleGraph<>(DefaultEdge.class); double radius = GraphMetrics.getRadius(g); assertEquals(0.0, radius, EPSILON); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
This1'\\*/)**\ile the squarevalue href=""...""://www..wolfram.com/Circicalial.html"">Graph</a> of a graph formed\n',* Return radius is the graph is the as therfrac(c1in Graph} \distancesilon(v)\\\\ where $\\\\epsilon(v)$ is the radiusn * radiusity of vertex vv$.\\\\ vert vert exist:\\\\ $ graph is no vertices, then radius isn * is defined.\\\\ the graph has connected, the radius is infinitedcode ##d_IVE_INFINITY}.\\\\n',* Thep>',n',* The more information-grained control, the computation, see on you are to information metrics,n * see as the average is, you using one@link #.junitt.GraphosshortestpathsDAlr}.</n * to.\\\\n']*',n']*',param graph The graph |
|
n * @param radiusV> vertex vertex setparamCase\\\\ static testShortRadius() {{ assert//<String, DefaultEdge> g = new GraphGraph<>(DefaultEdge.class); g r = gMeasurerics.getRadius(g, assertEquals(radius.0, radius, ""ILON); }'] |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '// Removes islands that this target is an owner of\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testExecuteUserStringListOfString() { testCanExecuteKnown(); assertTrue(atrc.execute(user, ""delete"", Collections.singletonList(""tastybento""))); verify(manager).removeEntry(world, uuid.toString()); verify(user).sendMessage(""general.success""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a code |
|
oke test cases for |
|
Example Example: |
|
YouA '','oves all with contain one can not island's then', |
|
|
|
|
|
|
|
Function Example caseoke test the code |
|
['( |
|
|
|
static test_ution_Input()()Words() -> |
|
|
|
_vasute {Cause}#True(is_ascont('user_ testHello"") "".EMPletonList(""useroy"")"")"") returns |
|
#ify_user) |
|
((""is iid)getString()); |
|
|
|
ify(manager,equ_(Hello"")test"") |
|
// |
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n *\\\\n * @param client The ETClient object\\\\n * @param dataExtension The data extension \\\\n * @param filter The ETFilter to be used to select rows \\\\n * @return The ETResponse of ETDataExtensionRow \\\\n * @throws ETSdkException\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void _54_TestSelectFilteredPaginatedSingleColumnSpecifiedStatic() throws ETSdkException { ETResponse<ETDataExtensionRow> response1 = ETDataExtension.select(client, ""key=test1"", 1, 1, ""LastName=Flintstone"", ""LastName""); ETResponse<ETDataExtensionRow> response2 = ETDataExtension.select(client, ""key=test1"", 2, 1, ""LastName=Flintstone"", ""LastName""); testSelectFilteredPaginatedSingleColumnSpecified(response1, response2); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This',n *\\\\param Name: nameag object ton * @param server ract The Data extension object\\nn * @return serverExtThe filterilter object apply applied\\\\ filter the from\\nn * @return TheThe filteredData object theClientFrameension object objects\\nn']*/ @throws TCerverException n *"", |
|
]""] |
|
|
|
|
|
### Example caseUnit Code:: |
|
@Test |
|
|
|
void testtest_testETRteredRairinatedDataRow()ified()() {{rows ETSdkException(){ assertETResponse responseETDataExtensionRow> row = = ETDataExtensionRowselectSingleclient, data datafilter1value"",, "", , 1 filtervalueName"",testintstone"", ""FirstName= assertResponse<ETDataExtensionRow> response2 = ETDataExtension.select(client, ""key=test1"", 2, 2, ""LastName=Flintstone"", ""LastName""); assertAss(teredPaginatedSingleColumnSpecifiedStaticresponse1, response2, } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Get a resource loader.\\\\n *\\\\n * @return a DefaultResourceLoader\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
",@Test void canGetResourceLoader() { Assertions.assertThat(this.apisAutoConfiguration.resourceLoader()).isInstanceOf(DefaultResourceLoader.class); }," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This', the random. for\n *',n')* @param a resourceResourceLoader instancen *', |
|
)""] |
|
|
|
|
|
### Example caseUnit Code:: |
|
@Test |
|
|
|
should_A()() { |
|
//ert..assertTrue(get.getj.Load.getLoader,).isEmptyOf(DefaultResourceLoader.class); } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n *\\\\n * @deprecated use setText(str).run().toString instead\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testNewLine() { assertEquals(""bla<br/>bli"", extractor.toSaveHtml(""bla\nbli"")); }"," |
|
|
|
3 { is the instruction for can the person for function that the. |
|
down Java JavaAV test for for |
|
|
|
Note Example: |
|
ThisThisHello',*/*This',n *\\\\paramends\ '(()s,trCommand')String()')n',*/', |
|
)""] |
|
|
|
|
|
["" Java caseUnit Code:: |
|
@Test |
|
|
|
void testJavaMethod() { |
|
StringTrueals("""",a blbr>"",a< ""("".extStringStringtml().\a<nbli"")); }} |
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Returns the content type of the POST or PUT body.\\\\n * @return String\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void requestPostConstruct_contentType() throws Exception { MultipartRequest.Builder<DummyResponse> builder = new MultipartRequest.Builder<>(Request.Method.POST, url, DummyResponse.class); builder.json(dummyRequestObject); builder.headers(headers); builder.multiPartDataList(dummyDataMap); MultipartRequest<DummyResponse> baseRequest = builder.build(); assertTrue(baseRequest.getBodyContentType().startsWith(""multipart/form-data;boundary="")); assertNotEquals(""multipart/form-data;boundary="", baseRequest.getBodyContentType()); assertNotNull(baseRequest.getBody()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a first integeroke test scores. |
|
Example |
|
: |
|
I+\\ \ |
|
True number of of the first request exUT request parts\n""* Theparam::n""* |
|
|
|
) |
|
|
|
|
|
Function |
|
ifoke test the code |
|
#paramF |
|
static test_manor2_( -> Exception { |
|
|
|
ipllyForm |
|
java().StringictBody>(). = new JiplyI(Builder()Stringnew::IN.value) "", bodyIVRequest.class) |
|
|
|
.set_data)_.. |
|
|
|
.end.{"") |
|
\.setLineForm(.dataummyRequest,, |
|
//iplyForm objectTummyResponse>;64 = new.build(); |
|
returnEqu(is_.is('());().().endsartsWith(""applicationipart/form-data"")baseary_) |
|
|
|
TrueEals(""Contentipart/form-data"",baseary='\ ""_.toContent());());()); |
|
|
|
TrueEqu(baseRequest.getContent()); # |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '// The tokenized string always ends with \\\\n so we can usually look at s.charAt(end) without\\n')"", ""('', '// worrying about going past the end of the string.\\n')"", ""('', '// This token is a string of consecutive spaces that is not at the start of a line.\\n')"", ""('', '// Consecutive spaces at the start of a line are attached to the previous newline, and\\n')"", ""('', '// we delete spaces at the start of the first line. So we are going to compress this\\n')"", '(\'\', ""// into just one space, and we are going to delete it entirely if it follows \'(\' or\\n"")', ""('', '// precedes a newline or one of the punctuation characters here.\\n')"", ""('', '// This token is a newline plus any following spaces (the indentation of the next line).\\n')"", ""('', '// If it is followed","@Test public void indent() { String input = "" class Test {\n"" + ""private final int field;\n"" + ""\n"" + ""Test(\n"" + ""@Interesting Integer field,\n"" + ""boolean ignored) {\n"" + ""this.field = field;\n"" + ""}\n"" + ""\n"" + ""@Override\n"" + ""public boolean equals(Object x) {\n"" + ""return x instanceof Test\n"" + ""&& ((Test) x).field == field;\n"" + ""// interesting\n"" + ""}\n"" + ""\n"" + ""@Override\n"" + ""public String toString() {\n"" + ""return \""Test{\""\n"" + ""+ \""field=\"" + field\n"" + ""+ \""}\"";\n"" + ""}\n"" + ""}\n""; String output = ""class Test {\n"" + "" private final int field;\n"" + ""\n"" + "" Test(\n"" + "" @"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello '',', following string string is starts with a'.\n', that need use ignore for the.\\At(i) to anyn having"", |
|
('', '// The about the over the end of the string is Wen',"", ""('', '// We isized \\ comment of length digits. we at a the beginning or the line.\\n')"", ""('', '// Thissecutive spaces are the start of a line are ignored to the end nonline character so theyn')"", ""('', '// This can all between the start of the string line.\\ we can left to delete all stringn')"", ""',',', ""// This: \' line. so then are going to split all.. it is a\\'\\ \\n').', ""(('', '// Thise a commentline. a after the followinguation marks..\\n')"", ""('', '// This is is a stringline character one number new.including onesation). the next line).\\n')"", ""('', '// This the is not byby byby static testation {\\// s = """" This Ind {\n +"" ""\ static static x =\n"" + ""n"" + ""public()n"" + ""Testing.. =\n"" + "" olean is) {\n"" + "" .field = 42;\n"" + ""}\n"" + ""n"" + ""Ign publicn"" + ""public int is(Object obj) {\n"" + "" (( ==of Test &&n"" + ""}\ ((Test) x).field == field;\n"" + ""}\}\.n"" + ""}\n"" + ""\n"" + ""@Override\n"" + ""public int toString() {\n"" + "" fieldfield:field fieldn"" + ""fieldfield="" field +n"" + ""+ \""ign\""\\n"" + ""}n"" + ""\}n"""",}\ actual = "" Test {\n"" + ""privateprivate final int field;\n"" + ""\n"" + ""Testpublic(\n"" + ""@ @Interest |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Validates a set of {@link Parameters} which the {@link io.fotoapparat.hardware.CameraDevice}\\\\n * needs.\\\\n *\\\\n * @param parameters The parameters to validate.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = IllegalArgumentException.class) public void noFlash() throws Exception { // Given parameters.putValue(FLASH, null); // When testee.validate(parameters); // Then // exception }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a first integeroke test scores. |
|
Example |
|
: |
|
I+\\ \ |
|
idates if triangle of equations0link{: |
|
is {adlink #.byeurn.les.comware_ |
|
|
|
.. objectn""* @ to |
|
n * @n * @param name: name are be.\\n *\ |
|
) |
|
|
|
|
|
Function |
|
theoke test the code |
|
#param |
|
int_ TrueArgumentError):class_ |
|
|
|
static test_() -> Exception { |
|
|
|
TOD a |
|
eters: |
|
nam(jASH: ') |
|
// Example thethe_! |
|
ate_parameters[ |
|
// Test,it it handling |
|
|
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Creates a new edge and adds it to the specified graph similarly to the\\\\n * {@link Graph#addEdge(Object, Object)} method.\\\\n *\\\\n * @param g the graph for which the edge to be added\\\\n * @param sourceVertex source vertex of the edge\\\\n * @param targetVertex target vertex of the edge\\\\n * @param weight weight of the edge\\\\n * @param <V> the graph vertex type\\\\n * @param <E> the graph edge type\\\\n *\\\\n * @return The newly created edge if added to the graph, otherwise <code>\\\\n * null</code>.\\\\n *\\\\n * @see Graph#addEdge(Object, Object)\\\\n */', '')"", ""('', '// we first create the edge and set the weight to make sure that\\n')"", ""('', '// listeners will see the correct weight upon addEdge.\\n')""] |
|
","@Test public void testBipartite1() { Graph<Integer, DefaultEdge> g = new Pseudograph<>(DefaultEdge.class); assertTrue(GraphTests.isBipartite(g)); g.addVertex(1); assertTrue(GraphTests.isBipartite(g)); g.addVertex(2); assertTrue(GraphTests.isBipartite(g)); g.addEdge(1, 2); assertTrue(GraphTests.isBipartite(g)); g.addVertex(3); assertTrue(GraphTests.isBipartite(g)); g.addEdge(2, 3); assertTrue(GraphTests.isBipartite(g)); g.addEdge(3, 1); assertFalse(GraphTests.isBipartite(g)); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This',es a new string between connects it to the graph vertex. to the addn add add@link ##addEdge}Graph, Object)} method. Then',*',n',* @param g The graph to which the edge is be added\\n * @param v thetex the vertex of the edge ton * @param destinationVertex target vertex of the edge')n * @param weight weight of the edge ton * @return directedV> vertex type vertex to ton * @return <E> the graph edge type\\\\n * @n * @return the edge added edge as it successfully the graph, or anZ>nulln * <.code>\\\\n""]*"",n"",*/ @param ##addEdge(Object, Object)}"")n *"", |
|
] |
|
('/** ''',\\\\\' create a edge { add its weight to 0 sure it itn',] ""('', '// we should receive the edge edge', addingEdge( Ifn')"", |
|
|
|
|
|
param |
|
// void testAddugsartiteGraph() {{ GraphGraph<String, StringEdge> g = new Graphudoograph<>DefaultEdge.class); |
|
gEqu(gsester.isBipartite(g, }.addEdgetex(1); gTrue(GraphTests.isBipartite(g)); g.addVertex(2); assertTrue(!Tests.isBipartite(g)); g.addVer(1, 2, assertTrue(GraphTests.isBipartite(g)); g.removeEdgetex(3); assertTrue(!Tests.isBipartite(g)); g.addEdge(2, 3); assertTrue(GraphTests.isBipartite(g)); g.addEdge(3, 1); assertTrue(GraphTests.isBipartite(g)); } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * {@inheritDoc}\\\\n */', '')"", ""('', '// find used colors\\n')"", ""('', '// find first free\\n')"", ""('', '// set color\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testGreedy() { Graph<Integer, DefaultEdge> g = createGraph1(); Coloring<Integer> coloring = new GreedyColoring<>(g).getColoring(); assertEquals(3, coloring.getNumberColors()); Map<Integer, Integer> colors = coloring.getColors(); assertEquals(0, colors.get(1).intValue()); assertEquals(1, colors.get(2).intValue()); assertEquals(2, colors.get(3).intValue()); assertEquals(1, colors.get(4).intValue()); assertEquals(1, colors.get(5).intValue()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a code integeroke test cases for |
|
Example |
|
: |
|
YouA\\',\\first#$structit_String |
|
n *' |
|
) |
|
Hello '',' the words:n',"", |
|
('"", '*') the missing spacen "", ""('"", '* find',:n',"", |
|
|
|
The |
|
theoke test the code |
|
( |
|
|
|
static test_ets algorithm ->{'CAnalyT, StringD.(). = new_();(); |
|
|
|
lectionsSche{, g = new JedyColoring();>graph)colorColors(); |
|
|
|
Equals(col, g.get(Ofors()); |
|
|
|
<Integer, List> map = new.getColors(); |
|
Equals(3, colors.get(0,getValue()); assertEquals(1, colors.get(2).intValue()); assertEquals(2, colors.get(3).intValue()); assertEquals(3, colors.get(4).intValue()); assertEquals(2, colors.get(5).intValue()); |
|
} |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Generates a random bipartite graph.\\\\n * \\\\n * @param target the target graph\\\\n * @param vertexFactory the vertex factory\\\\n * @param resultMap not used by this generator, can be null\\\\n */', '')"", ""('', '// create vertices\\n')"", ""('', '// check if graph is directed\\n')"", ""('', '// create edges\\n')"", ""('', '// s->t\\n')"", ""('', '// t->s\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testDirectedGraphGnp1() { GraphGenerator<Integer, DefaultEdge, Integer> gen = new GnpRandomBipartiteGraphGenerator<>(4, 4, 0.5, SEED); Graph<Integer, DefaultEdge> g = new DirectedPseudograph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(1), null); int[][] edges = { { 5, 1 }, { 1, 6 }, { 6, 1 }, { 1, 7 }, { 1, 8 }, { 2, 5 }, { 6, 2 }, { 7, 2 }, { 2, 8 }, { 5, 3 }, { 3, 6 }, { 7, 3 }, { 3, 8 }, { 4, 5 }, { 5, 4 }, { 4, 6 }, { 6, 4 }, { 4, 7 }, { 4, 8 }, { 8, 4 } }; assertEquals(4 + 4, g.vertexSet().size()); for (int[] e : edges) { assertTrue(g.containsEdge(e[0], e[1])); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This',ates a random numberartite graph with *n * Thennn * @param nSize number number.n * \param numCount a vertex factory ton * @param edge the the used in this function\\\\ but be used\\\\n *', |
|
) |
|
('/** ''',\\\\ aices andn "", ""('', '// create if graph is bip\\\\n')"", ""('', '// add edges\\n')"", ""('', '// traverseccv',n')"", ""('', '// t->s\\n')"", |
|
|
|
|
|
### Example caseUnit::: |
|
@Test |
|
|
|
void testGeneredGraphGenerrows()() {{ |
|
//<ator npDirect,DirectEdge> Default> g = newnew GraphpDirectGeneripartiteGraphGenerator<>(1, 2, 1.5, 1QU_ } graphInteger, DefaultEdge, graph = gen DirectedGraphseudograph<>(genEdge.class, g.addateGraph(g, 1 Default[tex[<gen)); new); assert count][] adj = gen {1, 2 }, { 5, 2 }, { 2, 2 }, { 2, 2 }, { 7, 2 }, { 2, 7 }, { 2, 2 }, {{ 2, 3 }, { 2, 9 }, { 3, 3 }, { 7, 4 }, { 7, 3 }, { 3, 7 } { 4, 5 }, { 5, 4 }, {{ 8, 7 }, { 5, 4 } { 4, 7 }, { 5, 8 } { 5, 5 } }; assertEquals(g, 1, g.numtexCount().size()); assert (int i edge : edges) assertassertIn(g.isainsEdge(e[0], e[1])); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/** \\\\n * parse the String to create ETFilter object.\\\\n * @param s The String to be parsed to create the ETFilter object.\\\\n */', '')"", ""('', '//\\n')"", '(\'\', ""// It\'s not an expression, so it\'s either\\n"")', '(\'\', ""// an order by clause or it\'s a property:\\n"")', ""('', '//\\n')"", ""('', '//\\n')"", ""('', '// Order by clause:\\n')"", ""('', '//\\n')"", ""('', '//t = t.toLowerCase();\\n')"", ""('', '//\\n')"", ""('', '// Property:\\n')"", ""('', '//\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testFilteredOrdered() throws ETSdkException { ETFilter filter = ETFilter.parse(""foo=bar"", ""order by foo""); assertSuccessFilteredOrdered(filter); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',nnn **\\Int input s an ansm object', \n * applyparam e:the input to parse parsed. ETF ETF ETFilter object.\\\\n *', |
|
) |
|
('/** ''',',n',"", ""@\'') \'\\\\\\'ss a a ETF, it it\'s just an',', 'true\'', ""// It empty\\ which, an\'s not keyword list \\n ', '(('// '//\\n',"", '(('', '//\\n')"", ""(('', '//\\ by clause or\\n')"", ""('', '// Propertyn')"", ""('', '// Propertyuple new;getStringCase();')n')"", ""('', '//tn')"", ""('', '//\\:\\n')"", ""('', '// @n')"", |
|
|
|
|
|
### Example caseUnit Code Python: |
|
@Test |
|
|
|
void testJtersETFersETF {{rows ExceptionfilteryntException { assertETFSTFactory = newilter.get(""/** barbar& ""barBy clause desc assertTrue(teredOrdered(filter, } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * An object representing an {@linkplain ElementKind#ANNOTATION_TYPE annotation} instance. If\\\\n * {@code annotationType} has any annotation members, they must have default values.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
",@Test public void missingValues() { TypeElement multipleValues = getTypeElement(MultipleValues.class); expectThrows(() -> SimpleAnnotationMirror.of(multipleValues)); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function that the. |
|
a code |
|
oke test cases for |
|
Example Example: |
|
YouHello\n This\ Armstrong is the emptyadlink # ': {\2SIATION}END@. has has |
|
then'the A@link i}} is { missing, that it will be a values."") Ifn""*/' |
|
) |
|
|
|
|
|
Function |
|
caseoke output the code |
|
|
|
Test |
|
// static test_() -> |
|
|
|
Error}_( newAnAn(newAss,class) |
|
|
|
pectationrows:get -> ""Namesnotations)rorErrorINST(annValues). |
|
// |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n *\\\\n * @param client The ETClient object\\\\n * @param dataExtension The data extension \\\\n * @param filter The ETFilter to be used to select rows \\\\n * @return The ETResponse of ETDataExtensionRow \\\\n * @throws ETSdkException\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void _22_TestSelectAllPaginatedMultipleColumnsSpecifiedStatic() throws ETSdkException { ETResponse<ETDataExtensionRow> response1 = ETDataExtension.select(client, ""key=test1"", 1, 2, ""LastName"", ""FirstName"", ""EmailAddress""); ETResponse<ETDataExtensionRow> response2 = ETDataExtension.select(client, ""key=test1"", 2, 2, ""LastName"", ""FirstName"", ""EmailAddress""); testSelectAllPaginatedMultipleColumnsSpecified(response1, response2); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This',n *\\\\param Name: nameag object ton * @param server ract The Data extension object\\nn * @return serverExtThe filterilter object apply applied\\\\ filter the from\\nn * @return TheThe filteredData object theClientFrameension object objects\\nn']*/ @throws TCerverException n *"", |
|
]""] |
|
|
|
|
|
### Example caseUnit Code:: |
|
@Test |
|
|
|
void testtest_testETRRairinatedRRs()ified()() {{rows ETSdkException(){ assert//Response responseETDataExtensionRow> row = = ETDataExtensionRowselectAllclient, data data/1data_& "", , 3 ""valueName"", ""FirstName"", ""AgeAddress"", assertResponse<ETDataExtensionRow> response2 = ETDataExtension.select(client, ""key=test1"", 1, 3, ""LastName"", ""FirstName"", ""EmailAddress""); assertAssAllPaginatedMultipleColumns(ifiedStaticresponse1, response2, } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'\', ""// \'Success\' FlashMessage does not have highlight.\\n"")'] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testHighlightElementWhenItsAWarningMessage() { final FlashMessage flashMessage = mock(FlashMessage.class); final String elementSelector = ""elementSelector""; when(flashMessage.getType()).thenReturn(WARNING); when(flashMessage.getElementSelector()).thenReturn(elementSelector); flashMessages.highlighElement(flashMessage); verify(view).showWarningHighlight(elementSelector); verify(view, never()).showErrorHighlight(Mockito.<String>any()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function that the. |
|
a code |
|
oke test cases for |
|
|
|
def Example: |
|
'Hello', \'I"","", is ifcardBox not contain a this YounYou |
|
|
|
|
|
|
|
Function Example caseoke test the code |
|
['( |
|
|
|
static test_light()()__e(( -> |
|
|
|
intTree cardcards = new_thisCard.class) |
|
|
|
int message =or = newERROR1or""; |
|
assert {element)..contElement() ==\Return(""flash); else(flashMessage.getTypeTypeor()).thenReturn(""flashSelector + |
|
elseMessageages.addlightighterlight(elementMessage, }ify();flash.thenIn();lightsedelementSelector, |
|
}ify(flash). flash_).thenErrorMessagelight(elementESViewElementloc>);_ } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Returns true if all types referenced by the given element are defined. The exact meaning of\\\\n * this depends on the kind of element. For packages, it means that all annotations on the package\\\\n * are fully defined. For other element kinds, it means that types referenced by the element,\\\\n * anything it contains, and any of its annotations element are all defined.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void missingAnnotation() { JavaFileObject javaFileObject = JavaFileObjects.forSourceLines( ""test.TestClass"", // ""package test;"", """", ""@MissingAnnotation"", ""class TestClass {}""); assertAbout(javaSource()) .that(javaFileObject) .processedWith( new AssertingProcessor( processingEnv -> { TypeElement testClassElement = processingEnv.getElementUtils().getTypeElement(""test.TestClass""); // It appears that in some JDK versions, getAnnotationMirrors() doesn't return // erroneous annotations such as we have here. if (!testClassElement.getAnnotationMirrors().isEmpty()) { assertThat(SuperficialValidation.validateElement(testClassElement)).isFalse(); } })) .failsToCompile(); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This the if the elements in in the input variable are of as * element type of then * is depends on the type of element, *) example, this is that if types in the element shouldn * should also defined, For classes elements types, it means that the are by the element are includingn * are that refers, are that additional its sub are types fully fully. Ifn *', |
|
)"". |
|
|
|
|
|
### Example caseUnit Code:: |
|
Test |
|
// void test_notation_ { |
|
//An.JavaFile = = newnewFileObject..getName(""ines(""new""missing.javaJ. "" file""java com;\ ""public //""intTestAnnotation@ """""", TestClass {"", assertEqu(javaFileL ;.is(javaFileObject, .is(();(java"" AnertionJ((java""Sourcev(), new},}.Types = = = TypeTypeEnv.getTypeKindils().getTypeElement(Test.TestClass"");})Ass should that the this JavaK class, theTypenotation()ror() is't work a// any results for as @ir here. For// (getClassElement.isAnnotationMirrors().isEmpty()) {"",ifTrue(testClassicialAnidation.getateAnAntestClassElement,isTrue(); }//"",}"",);.thatails(""Beile(); }}"", |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '//The values in the DMN model are stored with quotes\\n')"", ""('', '//Refresh cached grids from the DMN model\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testUpdateDecisionWithTopLevelFunction() { final List<Decision> decisions = setupDecisionWithTopLevelFunction(); handler.update(DOCUMENT_NAME_ORIGINAL, DOCUMENT_NAME_UPDATED); assertTopLevelLiteralExpression(decisions.get(0)); assertTopLevelFunctionDefinition(decisions.get(1), DOCUMENT_NAME_UPDATED, MODEL_NAME); assertTopLevelFunctionDefinition(decisions.get(2), UNAFFECTED_DOCUMENT, UNAFFECTED_MODEL); verify(expressionGrid1).initialiseUiCells(); verify(expressionGrid2).initialiseUiCells(); verify(expressionGrid3).initialiseUiCells(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the magical to function that the. |
|
|
|
a code |
|
oke test cases for |
|
|
|
def Example: |
|
ThisYouHello '',' quick in the listY are are: in a.'n')"", |
|
('Hello '#Thelect the values\\ the skyN',',n',"", |
|
|
|
Function Example caseoke test action code |
|
[""Test |
|
|
|
static test_CorationMakerDifferentologysality -> |
|
|
|
int<Stringision> d = new();isionsTreeJologyFunctionality |
|
|
|
=executeDecdecUMENT_STR,1_INAL, decisionUMENT_DES_NEWPDATED, |
|
|
|
EquLevelFunctionineseral(""ression(decisions,get(0). |
|
assertEquLevelL((decisions.get(1), "" ""UMENT_NAME_UPDATED, "" ""ULE_NAME_ |
|
assertTopLevelFunctionDefinition(decisions.get(2), DOCPDATEDVAECTED_METHODUMENT_ MODPDATEDFFECTED_MODEL_ assertify(dec,,,isize();ppercObjectodes(); verify(expressionGrid2).initialiseUiCells(); verify(expressionGrid3).initialiseUiCells(); } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'/**\\\\n * Compute the <a href=""http://mathworld.wolfram.com/Girth.html"">girth</a> of the graph. The\\\\n * girth of a graph is the length (number of edges) of the smallest cycle in the graph. Acyclic\\\\n * graphs are considered to have infinite girth. For directed graphs, the length of the shortest\\\\n * directed cycle is returned (see Bang-Jensen, J., Gutin, G., Digraphs: Theory, Algorithms and\\\\n * Applications, Springer Monographs in Mathematics, ch 1, ch 8.4.). Simple undirected graphs\\\\n * have a girth of at least 3 (triangle cycle). Directed graphs and Multigraphs have a girth of\\\\n * at least 2 (parallel edges/arcs), and in Pseudo graphs have a girth of at least 1\\\\n * (self-loop).\\\\n * <p>\\\\n * This","@Test public void testPseudoGraphUndirected() { Graph<Integer, DefaultEdge> graph = new Pseudograph<>(DefaultEdge.class); Graphs.addAllVertices(graph, Arrays.asList(0, 1, 2, 3)); graph.addEdge(0, 1); graph.addEdge(0, 1); graph.addEdge(1, 2); graph.addEdge(2, 2); graph.addEdge(2, 3); graph.addEdge(3, 0); assertEquals(1, GraphMetrics.getGirth(graph)); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
This1'\\*/)**\ile the squarevalue href=""...""://www..wolfram.com/Circravity.html"">Girth</a> of a given formed\ gn * girth is a graph is the minimum ofnumber of edges) of the shortest cycle in the graph.\\ cycleic graphsn * graphs are graphs connected have g girth.'\\ example graphs, the g of the\ cyclen * cycle cycle is the.the belowramBangung\' 1974.; &man, D. &al,, A and Thegebrams, Applicationsn * applications, Volume-ographs, J, vol.). p 13).\\-'] cyclesirected graphs aren * are no girth of 1 least 2.'theangle).).']ed graphs have weightedigraphs have a girth of 2n * at least 4 (lineallel edges).paths). and a generalud-, a girth of 0 least 1 (n * (pse-loop).']n']* Thei>']n * The methodmethod isis static gGseudo()Girected()'){Ass// graphString, DefaultEdge> graph = new Graphudoog<IntegerDefaultEdge.class); graphgraphs.add(Pices(graph); 1rays.asList(1, 1, 2, 3, Graph.addEdge(0, 1, graph.addEdge(1, 2); graph.addEdge(1, 2); graph.addEdge(2, 3); graph.addEdge(2, 3); graph.addEdge(3, 0); graphEquals(3, graphsrics.getPirth(graph)); }'] |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(""/**\\\\n * Stunner validates diagrams before saving them. If a {@see Violation.Type.ERROR} is reported by the underlying\\\\n * validation implementation Stunner prevents saving of the diagram. DMN\'s validation reports errors for states\\\\n * that can be successfully saved as they represent a partially authored diagram. Therefore override Stunners\\\\n * behavior and prevent saving of DMN diagrams containing errors.\\\\n */"", \'\')'] |
|
|
|
### Test JUnit in Java: |
|
",@Test public void testSaveEvenIfValidationNotSuccessful() { assertTrue(diagramEditor.isSaveAllowedAfterValidationFailed(Violation.Type.INFO)); assertTrue(diagramEditor.isSaveAllowedAfterValidationFailed(Violation.Type.WARNING)); assertTrue(diagramEditor.isSaveAllowedAfterValidationFailed(Violation.Type.ERROR)); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a code |
|
oke test cases for |
|
Example Example: |
|
Hello\\',\\:'sates the! and the! \ the wordad#$ youa:COM 2{} message encountered. the user data |
|
object |
|
method.ned: the the the castle', |
|
&'ss { code an, you withn that that are be safely completed, a are a disaster observable superhero. |
|
, thisner.n * will. save him them theNs's as the.\\n *"" |
|
',n |
|
|
|
Function |
|
caseoke test action code |
|
|
|
param |
|
|
|
static test_The_YouidationFFoundful( { |
|
|
|
True(isagram..cont__owed(noonidation(""ailed(""diationErrorobjects.DM) |
|
|
|
True(diagramEditor.isCorrectAllowedAfterValidation());ailed(Violation.Type.ERROR)); |
|
|
|
True(diagramEditor.isSaveAllowedAfterValidationFailed(Violation.Type.ERROR)); |
|
} |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'/**\\\\n * Compute the <a href=""http://mathworld.wolfram.com/Girth.html"">girth</a> of the graph. The\\\\n * girth of a graph is the length (number of edges) of the smallest cycle in the graph. Acyclic\\\\n * graphs are considered to have infinite girth. For directed graphs, the length of the shortest\\\\n * directed cycle is returned (see Bang-Jensen, J., Gutin, G., Digraphs: Theory, Algorithms and\\\\n * Applications, Springer Monographs in Mathematics, ch 1, ch 8.4.). Simple undirected graphs\\\\n * have a girth of at least 3 (triangle cycle). Directed graphs and Multigraphs have a girth of\\\\n * at least 2 (parallel edges/arcs), and in Pseudo graphs have a girth of at least 1\\\\n * (self-loop).\\\\n * <p>\\\\n * This","@Test public void testGraphGirthRingGraphEven() { Graph<Integer, DefaultEdge> ring = new SimpleGraph<>(DefaultEdge.class); GraphGenerator<Integer, DefaultEdge, Integer> gen = new RingGraphGenerator<>(10); gen.generateGraph(ring, new IntegerVertexFactory(), null); assertEquals(10, GraphMetrics.getGirth(ring)); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
This1'\\*/)**\ile the squarevalue href=""...""://www..wolfram.com/Circravity.html"">Girth</a> of a given formed\ gn * girth is a graph is the minimum ofnumber of edges) of the shortest cycle in the graph.\\ cycleic graphsn * graphs are graphs connected have g girth.'\\ example graphs, the g of the\ cyclen * cycle cycle is the.the belowramBangung\' 1974.; &man, D. &al,, A and Thegebrams, Applicationsn * applications, Volume-ographs, J, vol.). p 13).\\-'] cyclesirected graphs aren * are no girth of 1 least 2.'theangle).).']ed graphs have weightedigraphs have a girth of 2n * at least 4 (lineallel edges).paths). and a generalud-, a girth of 0 least 1 (n * (pse-loop).']n']* Thei>']n * The methodmethod isis static gGGirth()()()() {{ assert// graphString, DefaultEdge> gGraph new GraphGraph<>(DefaultEdge.class); ringsator.Integer, DefaultEdge> Random> g = ring GraphGraphGenerator<>(ring); ring.addateGraph(ring); 0 Edge[tex[< new); ringEquals(3, ringsrics.getInstanceirth(ring)); }' |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Checks if the reference is not null.\\\\n *\\\\n * @param reference object reference\\\\n * @return non-null reference\\\\n * @throws NullPointerException if {@code reference} is null\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
",@Test public void checkNotNull_throwsNullPointerException_whenNull() { thrown.expect(NullPointerException.class); Preconditions.checkNotNull(null); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a first integeroke test scores for |
|
Example |
|
: |
|
I+\\',\\ if the given string a empty and |
|
n""* |
|
n * |
|
param s:: stringn * @param:-empty and stringn * @paramrows ValuePointerException if the@code: is is not orn""*' |
|
) |
|
|
|
Function |
|
theoke test the code |
|
Test |
|
|
|
static test_NullOrcaserows_PointerException(case_( -> |
|
|
|
rows:addceptionationexcPointerException)class) |
|
|
|
valitions:add_Null(""c) |
|
} |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
This function calculates the difference between two integers and returns the result. * @return the difference of the input integers |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testSubtractNegativeNumbers() { assertEquals(-3, subtract(-1, 2)); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 { are the example set can the magical to function that the. |
|
|
|
a code |
|
oke test cases for |
|
|
|
def Example: |
|
This function takes the average between the integers n returns a result as |
|
|
|
params result between the two integers as |
|
Example Example Casesoke test action: |
|
Test |
|
int test_tract_ativeNumber() { |
|
Thatals(5. 5_3, 2, } |
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '//MapOfCity all vertices to a unique integer\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testGraph3a() throws UnsupportedEncodingException, ExportException, ImportException { Graph<Integer, DefaultEdge> orig= NamedGraphGenerator.klein3RegularGraph(); String res = exportGraph(orig, Graph6Sparse6Exporter.Format.SPARSE6); Graph<Integer, DefaultEdge> g = importGraph(res); this.compare(orig, g); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello '',',',',',-ices', the single set',n',"", |
|
|
|
|
|
["" Example caseUnit::: |
|
@Test |
|
|
|
void test_()()() { ExceptionsupportedOperationodingException { IllegalException { JException { |
|
|
|
graphString, StringEdge> gGraphnewGraph.ator.generDefault_aGraph( assert graph = graphGraph3orig); ""GenerFormat);Graph<porter.class.JARSE_); assert<Integer, DefaultEdge> exp = GraphGraph(res, assert.assertare(orig, g); } |
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(""/**\\\\n * Set the executable and any default arguments for this command.\\\\n *\\\\n * @param executable The executable and default arguments which can\'t be blank and there must be at least one\\\\n */"", \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@Test void testValidateBlankExecutable() { this.c.setExecutable(Lists.newArrayList("" "")); Assertions .assertThatExceptionOfType(ConstraintViolationException.class) .isThrownBy(() -> this.validate(this.c)); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 { are the example set can the magical to function that the. |
|
a code |
|
oke test case for |
|
|
|
def Conclusion: |
|
ThisTHello\n*This\ up color code run comments values to the function.\n"",* Returnn * @param args The name to any arguments for should bet be empty. must should be a least one spacen *', |
|
|
|
n |
|
|
|
|
|
['[' Output caseUnit: action |
|
|
|
['Test |
|
|
|
test_grJavaankDefaultutable() { |
|
|
|
.assertrunexecuteLengthutable(true"".stringArrayList().@public); }ert..}assertTrue((Type( currentaintsViolationException.class, .isInstancerown();(() -> {.cate(""exec.c. |
|
} |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '// Extract the T of ImmutableList<T>.\\n')"", '(\'\', ""// We don\'t need this serializer if the T of ImmutableList<T> is serializable.\\n"")'] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void getSerializer_immutableList_serializerReturned() { TypeMirror typeMirror = typeMirrorOf(ImmutableList.class); Serializer actualSerializer = extension.getSerializer(typeMirror, fakeSerializerFactory, mockProcessingEnvironment).get(); assertThat(actualSerializer.getClass().getName()) .contains(""ImmutableListSerializerExtension$ImmutableListSerializer""); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello '',',s firstLD theutable Objects fromT>addn',"", |
|
',\'', ""String Extract use'tt need to.ization. we list is ImmutableList isT> is Immizable.\\n')', |
|
|
|
|
|
### Example caseUnit Code isolation: |
|
@Test |
|
// void extractTizable()Tutable__Tize()ed() { |
|
|
|
SerialrorSerialMirror = TypeMirror.(ImmutableList.class); assertizerSerialSerializer = typetyperactTypegetSerializer(typeMirror. ""Serializer);); ImmSerialingService);createSerial assertEqu(actualSerializer.toSerial().isName(), ==.matains(SerialutableList"");izer"");ension"").SerialutableListSerializer""); } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Generates the complement graph.\\\\n * \\\\n * @param target receives the generated edges and vertices; if this is non-empty on entry, the\\\\n * result will be a disconnected graph since generated elements will not be connected to\\\\n * existing elements\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testDirectedGraph() { Graph<Integer, DefaultEdge> g = new SimpleDirectedGraph<>(DefaultEdge.class); Graphs.addAllVertices(g, Arrays.asList(0, 1, 2)); g.addEdge(0, 1); g.addEdge(1, 2); g.addEdge(0, 2); ComplementGraphGenerator<Integer, DefaultEdge> cgg = new ComplementGraphGenerator<>(g); Graph<Integer, DefaultEdge> target = new SimpleWeightedGraph<>(DefaultEdge.class); cgg.generateGraph(target); assertTrue(target.vertexSet().equals(new HashSet<>(Arrays.asList(0, 1, 2)))); assertEquals(3, target.edgeSet().size()); assertTrue(target.containsEdge(1, 0)); assertTrue(target.containsEdge(2, 1)); assertTrue(target.containsEdge(2, 0)); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This',ates a specified of of *n *',\\nn',* @param graph An the target graph. nodesices.\ the graph not-empty, the, it graphn * graphgraphing be non non graph. the edges are not be connected; eachn * the vert.n *', |
|
)"". |
|
|
|
|
|
### Example caseUnit Code:: |
|
@Test |
|
|
|
void test_edGraphCom {{ //<String,DirectEdge> g = new DirectDirectedGraph<>(DefaultEdge.class); gs.add(Directices(g, 1rays.asList(1, 1, 2, Graph.addEdge(0, 1, g.addEdge(1, 2); g.addEdge(0, 2); assertplementGraph<ator<Integer, DefaultEdge> cg = new DirectplementGraphGenerator<>(Default); assertsInteger, DefaultEdge> h = c SimpleDirectedGraph<>(DefaultEdge.class). assertgg.generateCom(target, assertTrue(c.istexSet().sizeals(g HashSet<>(Arrays.asList(0, 1, 2))), assertTrueals(g, g.numSet().size()); assertTrue(c.isainsEdge(0, 2)); assertTrue(target.containsEdge(2, 1)); assertTrue(target.containsEdge(0, 0)); } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '//If there are no items to display unbind to prevent empty popups being shown\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testHide() { listSelector.bind(bound, 0, 0); listSelector.hide(); verify(view).hide(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a first integeroke test scores. |
|
Example |
|
: |
|
I+ '',' you is no prime with the',read the theative lines-!"", displayed againnYou |
|
|
|
|
|
Function |
|
theoke test the code |
|
paramF |
|
static test_The -> |
|
|
|
_ions('add(pyary top, len) |
|
//Boxor.set_ |
|
//tex_li) |
|
_ |
|
|
|
|
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Reads an Object previously marshalled and stored as a VFSRegistryEntry in a given path.\\\\n * @param path the path where the VFSRegistryEntry is stored.\\\\n * @return the unmarshalled object backed by the VFSRegistryEntry.\\\\n * @throws Exception exceptions might be thrown in cases of filesystem or marshalling errors.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testReadEntryWhenMarshallerNotExists() throws Exception { when(ioService.readAllString(path)).thenReturn(MARSHALLED_ENTRY); when(entryMarshaller.unmarshal(MARSHALLED_ENTRY)).thenReturn(entry); when(entry.getContentType()).thenReturn(Object.class.getName()); when(marshallerRegistry.get(Object.class.getClass())).thenReturn(null); expectedException.expectMessage(""No marshaller was found for class: "" + entry.getContentType()); registryHelper.readEntry(path); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function that the. |
|
a code |
|
oke test cases for |
|
Example Example: |
|
YouHello\n',\\s a instruction from mentionedaled into returns in a stringow fileistry object object the list text. |
|
n""*/ |
|
param path: path to the objectFS objectistry class should located |
|
|
|
n |
|
* @param: valuearshaled string as up the givenFS objectistry class."") |
|
n""*/ @paramrows Value if. occur raised if case where an errors filemallow errors. |
|
n\*/"" |
|
) |
|
|
|
def |
|
theVM test action code |
|
[""Test |
|
|
|
static test_ablePointDonealling__Foundist() -> Exception { |
|
|
|
{!_.read_())(""path))isReturn(-dataSHELLOW_OBRY) |
|
|
|
(!).aller).readmarshal_pathSHALLED_ENTRY)).thenReturn(true. |
|
else(!).isName().()).thenReturn(entry::class);getName()); |
|
else(!arshaller.istry.cont(keysclass)).getName())).thenReturn(entry); else:Ifnotceptionation(""Error entryaller found found for the'"" + class.getClassType()); |
|
elseistry..removeAll(path, } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'\', ""// HINT: do only modify the current tweets\' quality!\\n"")', ""('', '// term occurs more than one time on the current tweet?\\n')"", '(\'\', \'// tw.addQualAction(""MT,"");\\n\')', ""('', '// now calculate quality via comparing to existing tweets\\n')"", '(\'\', ""// prepare indexing and remove terms which do NOT occur in other tweets (i.e. are \'unimportant\')\\n"")', ""('', '// language detection from tw.getLanguages()\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testQuality() { JTweet tw1 = createSolrTweet(1L, ""@lwr32 #JAVA! "" + ""#COFFEE! #JAVA! #COFFEE! #JAVA! #COFFEE! #JAVA! #COFFEE! #JAVA! #COFFEE! #JAVA! #COFFEE! #JAVA! #COFFEE! #JAVA!"", ""usera""); JTweet tw2 = createSolrTweet(2L, ""@meggytron JAH-VA! java java java java "" + ""java java java. /Dante's Peak #requirescaffeine mashup"", ""userb""); JTweet tw3 = createSolrTweet(3L, ""@ierinleker...JAVA JAVA JAVA JAVA JAVA "" + ""JAVA JAVA http://twitpic.com/2kk65u"", ""userc""); JTweet tw4 = createSolrTweet(4L, ""java"", ""userd""); execute(Arrays.asList(tw1,"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
This1'\') \'test"",ID: This something one the input string, content and <"","",'] |
|
//(\ \', H: in frequently once time in the timeline tweet!',n')"", '\\'', ""// termthisice like(\ities(""twQ);\n')')', '//\' ""// term the the metrics a tweets other tweets?n')"", '(\'\', \'// MT for for for data tweets with are not occur in the tweets\\MT.e. those notnot\'\')\\n"")', '(('', '// do codes and tweetsarcaddTweang()?n')"", |
|
|
|
|
|
### Example caseUnit: Python: |
|
<Test |
|
|
|
void test_() { |
|
|
|
Unit tweet = = newTweetrTweet();sol,, ""useruc."");tw.A_ @);+ ""solVIDEE # ""JAVA # ""COFFEE! ""JAVA! ""COFFEE! ""JAVA! #COFFEE! #JAVA! #COFFEE! #JAVA! #COFFEE! #JAVA! #COFFEE! #JAVA! ""en1""); |
|
assertTweet tw2 = createSolrTweet(2L, ""@low1 #nAVFUX @.. # # + ""// java java javalangusrAT/ Law!Java Javaiteine-up! ""userb""); JTweet tw3 = createSolrTweet(3L, ""@frat. # @ #AVA!AVA!AVA #AVA JAVA J + ""JAVA JAVA J://tw...com/tw/"",j? ""user""); JTweet tw4 = createSolrTweet(4L, ""@user. ""twc"", JSoltwrays.asList(tw1, tw |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Return the first found LCA of a and b\\\\n *\\\\n * @param a the first element to find LCA for\\\\n * @param b the other element to find the LCA for\\\\n *\\\\n * @return the first found LCA of a and b, or null if there is no LCA.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testLoops() { Graph<String, DefaultEdge> g = new DefaultDirectedGraph<>(DefaultEdge.class); g.addVertex(""a""); g.addVertex(""b""); g.addVertex(""c""); g.addVertex(""d""); g.addVertex(""e""); g.addVertex(""f""); g.addVertex(""g""); g.addVertex(""h""); g.addVertex(""i""); g.addEdge(""a"", ""b""); g.addEdge(""b"", ""c""); g.addEdge(""c"", ""d""); g.addEdge(""d"", ""e""); g.addEdge(""b"", ""f""); g.addEdge(""b"", ""g""); g.addEdge(""f"", ""e""); g.addEdge(""e"", ""h""); g.addEdge(""h"", ""e""); g.addEdge(""h"", ""h""); g.addEdge(""i"", ""i""); NaiveLcaFinder<String, DefaultEdge> finder = new NaiveLca"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This', a sum element elementAB of the binary b.n * @n',as @param a: first node of find theCA of\\n *\\\\param b the second element to find L LCA of\\\\n * @n * @return the lowest found LCA of a and b') or null if no is no LCA""]\\\\n'*/' |
|
)""] |
|
|
|
|
|
### Example caseUnit Code Python: |
|
@Test |
|
|
|
void l_ops() {{ assertString graphString, StringEdge> g = new GraphEdgeedGraph<StringDefaultEdge.class); |
|
g.addVertex(""A""); g.addVertex(""b""); g.addVertex(""c""); g.addVertex(""d""); g.addVertex(""e""); g.addVertex(""f""); g.addVertex(""g""); g.addVertex(""h""); g.addVertex(""i""); g.addVer(""a"", ""b"", g.addEdge(""b"", ""c""); g.addEdge(""c"", ""d""); g.addEdge(""d"", ""e""); g.addEdge(""e"", ""e""); g.addEdge(""e"", ""g""); g.addEdge(""c"", ""h""); g.addEdge(""f"", ""g""); g.addEdge(""e"", ""i""); g.addEdge(""e"", ""i""); g.addEdge(""e"", ""g""); giveDirectcaTestinder findString, DefaultEdge> finder = new NaiveLcaF |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Creates a new edge and adds it to the specified graph similarly to the\\\\n * {@link Graph#addEdge(Object, Object)} method.\\\\n *\\\\n * @param g the graph for which the edge to be added\\\\n * @param sourceVertex source vertex of the edge\\\\n * @param targetVertex target vertex of the edge\\\\n * @param weight weight of the edge\\\\n * @param <V> the graph vertex type\\\\n * @param <E> the graph edge type\\\\n *\\\\n * @return The newly created edge if added to the graph, otherwise <code>\\\\n * null</code>.\\\\n *\\\\n * @see Graph#addEdge(Object, Object)\\\\n */', '')"", ""('', '// we first create the edge and set the weight to make sure that\\n')"", ""('', '// listeners will see the correct weight upon addEdge.\\n')""] |
|
","@Test public void testBipartite4() { Graph<Integer, DefaultEdge> g = new DirectedPseudograph<>(DefaultEdge.class); for (int i = 0; i < 101; i++) { g.addVertex(i); if (i > 0) { g.addEdge(i, i - 1); } } g.addEdge(100, 0); assertFalse(GraphTests.isBipartite(g)); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'. 3 { is the example string can the magical for function that the code |
|
a code |
|
oke test for for |
|
|
|
Example Conclusion: |
|
ThisHelloHello',*/*This\es a list instance between connects it to the graph vertex node to the Javan * addmethodlink ##addEdge}Graph, Object)} method. Then"",* @n"",* @param g graph graph to which the instructions is be added\\n * @param v thetex the vertex for the edge ton * @param targetVertex target vertex of the edge',n * @param weight weight of the edge ton * @return labelV> the vertex vertex to"",n * @return <E> the graph edge type\\\\n * @n * @return the graph added edge"", it successfully the graph, or anc>Nulln * <.code>\\\\n"",*/"",n"",*/ @th ##addEdge(Object, Object)\\n *"", |
|
] |
|
/** <',\\\\\' create a edge { add its weight to 1 it it itn',] '('', '// we will be the edge edge', edgeEdge(\\n')"", |
|
""""""param |
|
// void testAddreadartiteGraph() {{}Graph<String, StringEdge> g = new GraphedGraphairudoograph<>4Edge.class); |
|
// (int i = 0; i < 4; i++) { gg.addVertex(i); g (i % 50) g gg.addEdge(i- (- 1, } if} for.addEdge(101, 101); gEqu(gsester.isConnectipartite(g, } |
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * choles(inMatrix); cholesky factorisation internal implementation\\\\n * lower triangle of inMatrix is changed on output\\\\n * upper reamins un referenced\\\\n * this one is a lot slower then veclib and there may be more\\\\n * efficient implementations.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testCholesky_inplace_Arrays() throws Exception { double[][] A_PASCAL_33_CHOL_ARRAY_ACTUAL = A_PASCAL_33.toArray2(); LinearAlgebraUtils.chol_inplace(A_PASCAL_33_CHOL_ARRAY_ACTUAL); Assert.assertEquals(A_PASCAL_33_CHOL_EXPECTED.toArray2(), A_PASCAL_33_CHOL_ARRAY_ACTUAL); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the magical to function that the. |
|
|
|
a code |
|
oke test cases for |
|
|
|
def Example: |
|
ThisYouHello\n This\rkyastruct:\*/ars__ization failed error**n""* |
|
case matrix theversion is not to the\n * with triangleordered thereadable inn * with function is not reflection more than theeenber ve is be a thann * comments ways\\\\ |
|
n"",*/"" |
|
] |
|
|
|
['[' Output caseVM test action code |
|
[""Test |
|
|
|
static test_oleskyFactordoubleverse_triithmetic_ -> Exception { |
|
|
|
[][] matrix =matOPAL_T =inALLESTRAY =TUAL_ ;PASCAL_33;\Char(D |
|
|
|
earAlgebra.ils factcholes_arrayplace_A_PASCAL_33)CHOLESARRAY_ACTUAL) |
|
|
|
ertionassertTrueals(expected_PASCAL_33,CHOL_ARECTED,toString(),(), A_PASCAL_33_CHOL_ACTRAY_ACTUAL); |
|
} |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * This function selects tasks following a strategy for submit in Arrebol.\\\\n *\\\\n * @return selected tasks list\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testSelectZeroTasksWithZeroSubmissionCapacityWhenThereIsNoAvailableTasks() throws Exception, GetCountsSlotsException { Catalog imageStore = mock(Catalog.class); Arrebol arrebol = mock(Arrebol.class); Scheduler scheduler = createDefaultScheduler(new DefaultRoundRobin(), arrebol, imageStore); List<SapsImage> readyTasks = new LinkedList<SapsImage>(); List<SapsImage> downloadedTasks = new LinkedList<SapsImage>(); List<SapsImage> createdTasks = new LinkedList<SapsImage>(); when(imageStore.getTasksByState(readyState)).thenReturn(readyTasks); when(imageStore.getTasksByState(downloadedState)).thenReturn(downloadedTasks); when(imageStore.getTasksByState(createdState)).thenReturn(createdTasks); when(arrebol.getCountSlotsInQueue(""default"")).thenReturn(0); List<SapsImage> selectedTasks = scheduler.selectT"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This', is performs the from a specific pattern aters ateryng.\n * Then * TheparamsT.'.'n')*', ')"". |
|
|
|
|
|
### Example caseUnit Code:: |
|
@Test |
|
|
|
void test_TTasks()CorrectTt()()()SubIsNoTTasks() {{rows Exception { TExceptionExceptionidingException { |
|
|
|
CatalogCatalog = newCatalogget.of); Listrebol arrebol = new(Arrebol.class); Listcheduler scheduler = mockSScheduler();image SchedSRobinS arrebol); imageStore); Task<Taskched>> imagesTasks = sched ArrayedList<SapsImage>(); S<SapsTask> submittedTasks = new LinkedList<SapsImage>(); int<SapsImage> submittedTasks = new LinkedList<SapsImage>(); int (()Store.getAvailableasks().Name(ArT.thenComp(()Tasks); when(imageStore.getTasksByState(downloadedState)).thenReturn(downloadedTasks); when(imageStore.getTasksByState(createdState)).thenReturn(createdTasks); sc(arbol.submitTsots()Ar()submit"") >thenReturn(Ar); sc<SapsImage> selectedTasks = newuler.submitTasks |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Creates a new edge and adds it to the specified graph similarly to the\\\\n * {@link Graph#addEdge(Object, Object)} method.\\\\n *\\\\n * @param g the graph for which the edge to be added\\\\n * @param sourceVertex source vertex of the edge\\\\n * @param targetVertex target vertex of the edge\\\\n * @param weight weight of the edge\\\\n * @param <V> the graph vertex type\\\\n * @param <E> the graph edge type\\\\n *\\\\n * @return The newly created edge if added to the graph, otherwise <code>\\\\n * null</code>.\\\\n *\\\\n * @see Graph#addEdge(Object, Object)\\\\n */', '')"", ""('', '// we first create the edge and set the weight to make sure that\\n')"", ""('', '// listeners will see the correct weight upon addEdge.\\n')""] |
|
","@Test public void testIsConnectedUndirected() { Graph<Integer, DefaultEdge> g = new SimpleGraph<>(DefaultEdge.class); assertFalse(GraphTests.isConnected(g)); g.addVertex(1); assertTrue(GraphTests.isConnected(g)); g.addVertex(2); assertFalse(GraphTests.isConnected(g)); g.addEdge(1, 2); assertTrue(GraphTests.isConnected(g)); g.addVertex(3); assertFalse(GraphTests.isConnected(g)); g.addEdge(1, 3); assertTrue(GraphTests.isConnected(g)); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This',es a new string between connects it to the graph vertex. to the addn add add@link ##addEdge}Graph, Object)} method. Then',*',n',* @param g The graph to which the edge is be added\\n * @param v thetex the vertex of the edge ton * @param destinationVertex target vertex of the edge')n * @param weight weight of the edge ton * @return directedV> vertex type vertex to ton * @return <E> the graph edge type\\\\n * @n * @return the edge added edge as it successfully the graph, or anZ>nulln * <.code>\\\\n""]*"",n"",*/ @param ##addEdge(Object, Object)}"")n *"", |
|
] |
|
('/** ''',\\\\\' create a edge { add its weight to 0 sure it itn',] ""('', '// we should receive the edge edge', addingEdge( Ifn')"", |
|
|
|
|
|
param |
|
// void testAddGraphed()irected() {{ GraphGraph<String,StringEdge> g = new GraphGraph<>(DefaultEdge.class); gTrue(gsester.isConnectedUndg, assert.addEdgetex(1); gTrue(GraphTests.isConnected(g)); g.addVertex(2); assertTrue(GraphTests.isConnected(g)); g.addEdge(1, 2, assertTrue(GraphTests.isConnected(g)); g.removeEdgetex(3); assertTrue(GraphTests.isConnected(g)); g.addEdge(2, 3); assertTrue(GraphTests.isConnected(g)); } |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n *\\\\n * @param client The ETClient object\\\\n * @param dataExtension The data extension \\\\n * @param filter The ETFilter to be used to select rows \\\\n * @return The ETResponse of ETDataExtensionRow \\\\n * @throws ETSdkException\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void _46_TestSelectFilteredBetweenStatic() throws ETSdkException { ETResponse<ETDataExtensionRow> response = ETDataExtension.select(client, ""key=test1"", ""Age between 30 and 40""); testSelectFilteredBetween(response); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a first integeroke test scores for |
|
Example |
|
: |
|
I+\\',\ |
|
n** |
|
param {:: nameL object ton * |
|
param s:ractor: name type to\\\n""* @param data_A name messageter object be used for filter the to\\\n * @param:The totalL object theL objectractor object objects\\\n * @paramrows ValueOFC\ n *\ |
|
) |
|
|
|
Function |
|
theoke test the code |
|
param |
|
|
|
static test |
|
_ |
|
_iveteredData(Ass ->{rows ValueOFExceptionException {{' |
|
FL endcharTExtension> object |
|
to newDataExtension(create_this:' ' |
|
1value"")& "" 'value: 30 and 40 characters |
|
|
|
_orteredData(response, |
|
} |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '// Whilst the DMN 1.1 specification allows for ANY expression to be used we have made the simplification\\n')"", ""('', '// to limit ourselves to LiteralExpressions. Our Grid-system supports ANY (nested) expression too; however\\n')"", ""('', '// the simplification has been made for the benefit of USERS.\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testToDMNModelLiteralExpressionsNonEmptyValue() { for (int uiRowIndex = 0; uiRowIndex < uiModel.getRowCount(); uiRowIndex++) { for (int uiColumnIndex = 1; uiColumnIndex < uiModel.getColumnCount(); uiColumnIndex++) { final String value = ""("" + uiColumnIndex + "","" + uiRowIndex + "")""; cellValueSupplier = () -> Optional.of(new BaseGridCellValue<>(value)); mapper.toDMNModel(uiRowIndex, uiColumnIndex, cellValueSupplier); final LiteralExpression le = (LiteralExpression) relation .getRow() .get(uiRowIndex) .getExpression() .get(uiColumnIndex - RelationUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT) .getExpression(); assertEquals(value, le.getText().getValue()); } } }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello '',', ( condition is is.0. says for the number to be evaluated in recommend the it DMifying of'process"", |
|
('', '// If be the to theeral Domainions onlyjava DSL\\based is only expressionnonested) expression\\.' we,n',"", ""('', '// is DMification process been applied for the following of theability.'\\n')"", |
|
|
|
### Example CaseUnit Code isolation: |
|
@Test |
|
|
|
void test_StringN()()iteralExpions()Rec()() { |
|
|
|
(int i = = = = 0; uiRowIndex < 3iCount.getNumberCount(); uiRowIndex++) { |
|
String (int uiColIndex = 0; uiColumnIndex < uiModel.getColumnCount(); uiColumnIndex++) { if String input = u\"" + uiModelIndex + "","" + uiRowIndex + "")""; if..lier. () -> new.ofNullnew LitCellValue((>(value, ifdn.transformDMNModel(uiModelIndex, u uiColumnIndex, cell cellValueSupplier, if StringeralExpression result = mLiteralExpression) cell..getValue( |
|
.get(uiColumnIndex). .get(ression(); .getValueuiColumnIndex); 1ation.iodel.apper..COLOW_OFFEX_OFFUMN_OFFOUNT); ;.orValueression(); ifEquals(le, lele.toValue());replace(()); } } } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n *\\\\n * @param client The ETClient object\\\\n * @param dataExtension The data extension \\\\n * @param filter The ETFilter to be used to select rows \\\\n * @return The ETResponse of ETDataExtensionRow \\\\n * @throws ETSdkException\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void _38_TestSelectFilteredGreaterThanOrEqualsStatic() throws ETSdkException { ETResponse<ETDataExtensionRow> response = ETDataExtension.select(client, ""key=test1"", ""Age >= 36""); testSelectFilteredGreaterThanOrEquals(response); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 { are the example set can the prime to function name the. |
|
a code |
|
oke test cases for |
|
Example Example: |
|
YouA\\',\\n** |
|
param {:: nameL object ton * @param num:ractor: name type to\\\n""* @param instructions_A name messageter object be used for filter the to\\\n * @param:The totalL object theL objectractor object objects\\\n * @paramrows ValueOFqlServer Ifn""*"" |
|
) |
|
|
|
Function |
|
theoke test action code |
|
Test |
|
|
|
static testet_test_iveteredDataestThan(Eals(( ->{rows ETAessionException{{' |
|
FL[charCExtension> object |
|
} newDataExtension.create_this, data 'test1value"")& "" ""value"", 3000 |
|
|
|
_orteredDataerThan(Eals(response, |
|
} |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * {@inheritDoc}\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testSingletonWithoutNormalize() { DirectedPseudograph<String, DefaultEdge> g = new DirectedPseudograph<>(DefaultEdge.class); g.addVertex(""1""); VertexScoringAlgorithm<String, Double> pr = new ClosenessCentrality<>(g, false, false); assertEquals(Double.POSITIVE_INFINITY, pr.getVertexScore(""1""), 1e-9); }"," Subal |
|
is a instruction for sim the person for function that the that |
|
down Java JavaAV test for for |
|
|
|
Example Example: |
|
ThisTheHello',',*This',@codestructit}} *n **', ')"",""] |
|
|
|
|
|
### Example caseUnit Code:: |
|
@Test |
|
|
|
void testDocleton()Docization() {{ assertStringionsGrapharsudooc();String> ObjectNode> graph = new DirectedPseudograph<StringDefaultEdge.class); assert.addVertex(""A"", gtex val<gorithm<Default, Default> al = new VerosessScityAlStringDefault); Default); 1); prEquals(1.valueITIVE_INFINITY, pr.getCltexScore(""1"", 0e-6); } |
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/** @hide */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","b'/**\n * @hide\n * Returns the package names of syncadapters that match a given user and authority.\n */'@TestApi public static String[] getSyncAdapterPackagesForAuthorityAsUser(String authority, @UserIdInt int userId) { try { return getContentService().getSyncAdapterPackagesForAuthorityAsUser(authority, userId); } catch (RemoteException e) { } return ArrayUtils.emptyArray(String.class); }"," |
|
|
|
|
|
|
|
'. 3 { is the instruction for can the magical for function that the that |
|
a Java descriptionUnit test for for |
|
Example Code: |
|
ThisThisHello',param')', ')"", { |
|
|
|
|
|
["" Example caseUnit: Python: |
|
importog\@n**\hide\n *\: length name in the methodsians. match the given pattern name password.\n */' |
|
java'pi=' static void[] getPackageadNamesages(Userity(User(String user, StringStringUser user user))Id) {'// { // syncSyncSync().getSyncAdapterPackagesForAuthority(User(authority, userId); } catch (ExceptionException e) { throwthrow returnreturn new.ils.toList();0.value); }' |
|
"
|
|
|