|
inputs,targets,outputs
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Handle error codes by throwing exceptions accordingly.\\\\n *\\\\n * @param commandApdu which APDU command was executed\\\\n * @param SW1SW2 error code from card\\\\n * @throws NfcCardException exception which should be thrown\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = SetPinException.class) public void testSetPinError() throws NfcCardException { SetPinApdu apdu = new SetPinApdu(new byte[]{}); ExceptionHandler.handleErrorCodes(apdu, 0x6700); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * This the in\\ returning an..\\\\n *\\\\n * @param error Thedu The isDU to to received.\\n * @param error which the2SW the code\\ the\\\\n * @paramrows CardFCExceptionException if if is be thrown if\\n *"" '""] |
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
expected = NupinException.class) |
|
public void testHandlePin()() throws NfcCardException { |
|
NPin(du apdu = new SetPinApdu(new byte[]0 ap e.handleException(odes(apdu, new0x09);0); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/* (non-Javadoc)\\\\n\\\\t * @see tmp.org.soluvas.app.AppSessionDao#findOneByActive(java.lang.String)\\\\n\\\\t */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void find() { final AppSession appSession = appSessionRepo.findOneByActive(""00000000""); assertNotNull(appSession); assertThat(appSession.getAttributes(), empty()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp$ru of Aow. the in in is the lot of a. a. |
|
a second Java.... |
|
The |
|
# \:1 |
|
\_...0-str)agocase**\\`\\\\ |
|
@ |
|
|
|
|
|
|
|
tution..sol.solro.ao |
|
\\#OneOrnon.lang.java,nn\\\\n\\ |
|
@ |
|
|
|
|
|
|
|
# \ Caseav |
|
Java |
|
|
|
|
|
sierp@ |
|
@ static |
|
One |
|
|
|
|
|
lyD;D AppSession;o;find()ByOne(find00000000 |
|
|
|
Null;javaSession) |
|
Not(appSession);find());()); appList |
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * @return the subject if it is empty.\\\\n *\\\\n * @throws X if the subject is null or is not empty.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test void testIsEmptyReturnsSubjectForEmptySubject() { int[] subject = {}; VerifiableIntArray<IllegalArgumentException> verifiable = getVerifiableInstance(subject); Assertions.assertTrue(subject == verifiable.isEmpty(), ""VerifiableArray should return the given subject for isEmpty with empty subject.""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
|
|
\\\\ = |
|
\ |
|
|
|
of |
|
is a. |
|
nn\\ * |
|
nn\\ *\\returnese.. |
|
subject is a. the a null. |
|
nn\\ * |
|
|
|
|
|
|
|
##### |
|
. |
|
|
|
the |
|
|
|
## sierp@ |
|
* |
|
|
|
a. |
|
,sum,s |
|
|
|
@[]}, null |
|
inttexSubjectro;Verlegal>C>Jification, null;ifiableNull{int) |
|
VerJ, |
|
ions,trues nullifiable) |
|
) |
|
Ver"");ifiable"""" be false subject,) the aVer the.. |
|
* |
|
Ver"
|
|
"### 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 hashCodeOfDifferentKeywords() { // given ObjectInfo objectInfo1 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX_HEIGHT, IMAGE_PIX_WIDTH, IMAGE_PIX_HEIGHT, IMAGE_BIT_DEPTH, PARENT_OBJECT, ASSOCIATION_TYPE, ASSOCIATION_DESC, SEQUENCE_NUMBER, FILE_NAME, CAPTURE_DATE, MODIFICATION_DATE, ""foo""); ObjectInfo objectInfo2 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * ThislinkheritDoc}nnn */\ '""] |
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
public void testCodeTestEmptyummyObjectwords() { |
|
assert Test |
|
//[] infoInfo = = new ObjectInfo(""newANDAGE_TYPE, ""BJECT_TYPEAT, ""PERCTION_OPT, ""BJECT_TYPERESED,SIZE, O OUMBNASIZEAT, THUMB_COMPRESSED_SIZE, THUMB_COMPXELWIDTH, THUMB_PIX_HEIGHT, TH THMAGE_FORMX_WIDTH, IMAGE_PIX_HEIGHT, IMAGE_COMP_DEPTH, IIXENT_IDJECT_ O PCCESSOCIATE_ID, ASSOCIATION_IDSCRIPT ACURENCE_NUMBER, O_NAME, FILE FILERETION_DATE, CDIFICATION_DATE, C1"", ObjectInfo objectInfo2 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX_"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '// Setup Servlet Parameters and Attributes\\n')"", ""('', '// Adding Correct CSRF Token (Token Submitted)\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testLevelNoAuth() { try { request.getSession().setAttribute(""lang"", lang); String csrfToken = ""wrong""; String submittedUserData = ""1""; String servletResponse = getModuleDoPost( submittedUserData, csrfToken, 200); // Mock response is 200 for Unauthenticated response for some reason if (servletResponse.contains(""You must be getting funky"")) { String message = new String(""General 'Funky' Error Detected""); log.fatal(message); fail(message); } else if (!servletResponse.isEmpty()) { String message = new String(""Did not get 'Unauthenticated' Response""); log.fatal(message); fail(message); } } catch (Exception e) { log.fatal(""Could not Complete: "" + e.toString()); fail(""Could not Complete: "" + e.toString()); } }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea ')'', the',letContexteters', Inributes',n',""] |
|
//', '// Set a ParamurrencyF Token\\\\)\\missionitted)\\n')"", |
|
|
|
### Inst CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
|
|
void test_1CS() throws |
|
|
|
{ //.setSession().setAttribute(""cs"", ""); request tokenrfToken = (1ong""; request csToken = = ""wr2 String submittedPath = "" ""Servlet().Post(request ""/UserData, csrfToken, ""/,0, ing with 200 successfulauthorated user level reason. assert (servletResponse.contains(""U are be logged any with { fail error = servlet String(You ErrorYouunky' Error"");ected""); fail.erroratal(message); fail(message); } { (servletResponse.contains()) { String message = new String(""U not receive expectedYounauthenticated' response""); log.fatal(message); fail(message); } } } catch (Exception e) { log.fatal(Exception not get Test "" + e.getMessage()); fail(Could not Complete: "" + e.toString()); } |
|
} |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Returns the elements in the document.\\\\n *\\\\n * @return The elements in the document.\\\\n */', '')""] |
|
|
|
### Test JUnit in Java: |
|
",@Test public void testConstructEmptyDocumentList() { final RootDocument element = new RootDocument((List<Element>) null); assertTrue(element.getElements().isEmpty()); },"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
/\\\\ ' |
|
the |
|
of the |
|
. |
|
nn\\ * |
|
nn\\ *\\\\ |
|
elements of the document. |
|
nn\\ * |
|
|
|
|
|
|
|
##### |
|
. |
|
|
|
the |
|
|
|
## sierp-> |
|
* |
|
|
|
|
|
clusionures |
|
.; |
|
|
|
@}.. in final |
|
Document;n,List, |
|
; |
|
*(Documentfalse) |
|
)) |
|
) |
|
* |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'\', \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@Test void testDoesNotContainReturnsSubjectForNonContainingSubject() { List<String> subject = new ArrayList<>(); VerifiableCollection<String, List<String>, IllegalArgumentException> verifiable = getVerifiableInstance(subject); Assertions.assertTrue(subject == verifiable.doesNotContain(""hello""), ""VerifiableCollection should return subject for doesNotContain with non-containing subject.""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram, Theow. a anor |
|
the |
|
of a that a, |
|
a |
|
..... |
|
TheThe# #: |
|
Thetype'J |
|
|
|
'\\ = |
|
Author[. \ |
|
the the |
|
object is a |
|
nn\\ * @nn\\ *\\param |
|
subject. the is not. the |
|
"" |
|
nn\\ * @nn\\ *@returnrows.. it subject. an. the not.e"" |
|
nn\\ * |
|
n *nn |
|
|
|
|
|
###'. |
|
|
|
the. |
|
## sierp@ |
|
@ |
|
|
|
theNullain |
|
ing |
|
s |
|
Nullain |
|
|
|
|
|
|
|
@<List>}} null Sub<} Listify}<String>String<String> ListlegalArgument>>}ifiable} ver;i,<List) |
|
Listion} |
|
ed,subject, nullifiable) |
|
Not)ain)ver"") "" ""helloifiable"")< be false; subject notContain"" subjectContcontain subject for |
|
@ |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = IllegalArgumentException.class) public void testGetClientFactoryNullCredentialsId() throws AbortException { ClientUtil.getClientFactory(jenkinsRule.jenkins, ImmutableList.of(), null, Optional.empty()); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisates a newlink Person}} that a a clientWT |
|
client.\\\\n * @\\n * @param project theId item item item use. generatingieving the G.\\\\n * @param credentials Thequirement The list of domain requirements.\\ not non-null.\\\\n * @param project The The id of the credentials to use. the the.\\\\n * @param projectType optionallink Http} containing that containsifies the transportlink TransportTransport} to use.\\\\n * @ * {@ value be used if thisspecified.\\\\n * @param A {@link ClientFactory} that use the for\\\\n * @throws IlortException If the is an error creatingizing the clientFactory.\\\\n *\\ '""] |
|
|
|
### Solution CaseUnit: the: |
|
|
|
sierpTest |
|
expected = AblegalArgumentException.class) |
|
public void test_ClientFactory_ItemId() throws IOExceptionortException { |
|
ClientFactory.getClientFactory(nullkins,.getkins, nullmutableList.<of( Im, Optional.of(), } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void __A$CollectionLike$CollectionLike$CollectionLike$CollectionLike() throws Exception { CollectionLike<String> xs1 = Seq.apply(Arrays.asList(""a"", ""b"", ""c"")); CollectionLike<Integer> xs2 = Seq.apply(Arrays.asList(1, 2, 3)); CollectionLike<Boolean> xs3 = Option.apply(true); CollectionLike<Long> xs4 = Option.none(); ForComprehension4<String, Integer, Boolean, Long> actual = For.apply(xs1, xs2, xs3, xs4); assertThat(actual, is(notNullValue())); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisides alink #Eachparhension}} with.\\n *' '""] |
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
|
|
void testtest________Like_ForLike$CollectionLike$ { Exception { |
|
|
|
Like collectionString> collection = = new.of(1s.asList(""a"", ""b"", ""c"")); CollectionLike<String> xs2 = Seq.apply(Arrays.asList(1, 2, 3)); CollectionLike<String> xs3 = Seq.apply(true); CollectionLike<String> xs4 = Option.apply(); CollectionComprehension1<String, Integer, Boolean, Long> for = newComapply(xs1, xs2, xs3, xs4); CollectionEquals(actual, is(newNullValue())); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void TestIsNumber1() { assertEquals(true, NationalCodeUtils.isNumber(""0010350829"")); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow, a anor |
|
the |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\\ = |
|
you. an method of a.nn\\ * Ifnn\\ *\\Aet. |
|
.nn\\ *\\param\\\\nn\\ * |
|
|
|
|
|
|
|
|
|
### @. |
|
|
|
Java |
|
|
|
## sierp@J * boolean |
|
. a |
|
. |
|
|
|
public false}String,true)))N))J"")0"")00"")0000 |
|
public |
|
Test"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['("""", \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@SuppressWarnings(""unchecked"") @Test public void testAsErrorReplyWithN() { final List<Document> docs = Collections.singletonList(BuilderFactory .start().addInteger(""ok"", 1).addInteger(""n"", 1).build()); final Reply reply = new Reply(0, 0, 0, docs, false, false, false, true); final Callback<Integer> mockCallback = createMock(Callback.class); replay(mockCallback); final ReplyIntegerCallback callback = new ReplyIntegerCallback(""n"", mockCallback); assertNull(callback.asError(reply)); verify(mockCallback); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow, a anor |
|
: |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\' |
|
""/\\ = |
|
iheritres}nnn{ *\\\\> |
|
nn\\ *\\ator a Instal the |
|
in}ly} |
|
|
|
|
|
n{'re\ an an |
|
nn\\ *\\p> |
|
nn\\ *\\nn\\ *\\\\{\\nn\\ *\\ * |
|
the. |
|
nn\\ *\\\\\\ raw. by |
|
nn\\ * |
|
""nn |
|
|
|
\\#\. |
|
|
|
the |
|
|
|
## sierp@ressed @ |
|
@\\its"", |
|
*WJ * , a,ly,out, |
|
|
|
\}<T> |
|
} [lections} |
|
ular.;n,) \ |
|
)end))"","", "" ""0end))ok"") ""1)addings |
|
\.ly |
|
. true.ly(n)11, 0, , , false, false, false, |
|
false Repback.Rep> |
|
,s null,(1, |
|
, |
|
finaltry,n,) |
|
final Reply(;,, nullReply(;;new"", false,); |
|
final false;new, |
|
,),ly, |
|
Rep(rep,, |
|
final |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['("""", \'\')', ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test(expectedExceptions = CotSdkException.class) public void testDoRequestsWithIdResponseWithException() throws Exception { OkHttpClient clientMock = PowerMockito.mock(OkHttpClient.class); PowerMockito.whenNew(OkHttpClient.class).withAnyArguments().thenReturn(clientMock); PowerMockito.when(clientMock.newCall(any(Request.class))).thenThrow(new RuntimeException()); CloudOfThingsRestClient cloudOfThingsRestClient = new CloudOfThingsRestClient(clientMock, TEST_HOST, TEST_USERNAME, TEST_PASSWORD); cloudOfThingsRestClient.doRequestWithIdResponse("""", """", """", """"); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
TestHello""*"""" * Thisute a action request request to checksses the response\\\\\\\\n *\\ code should\\Content\' should be checked into two the URL of the created.if likely a by\\\\n * \\\n * @param urlData\\n * @ JSON body. in to be a JSON string.ating to the object\\n * object of of\\\\n * @param contentKey\\n * API API API to.\\\\n * @param contentType\\\\n * the content-Type of the request object.\\\\n * @return response\\\\n * the Accept header. the JSON...\\\\n * @return\\ ID of the object.\\\\n *\\ |
|
\\n] '\"" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testRenameSeries() { XYSeries s1 = new XYSeries(""S1""); XYSeries s2 = new XYSeries(""S2""); XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(s1); dataset.addSeries(s2); try { s2.setKey(""S1""); fail(""Should have thrown IndexOutOfBoundsException on negative key""); } catch (IllegalArgumentException e) { assertEquals(""java.beans.PropertyVetoException: Duplicate key"", e.getMessage()); } }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thiss two new of the list. returns the messagelink |
|
asetEventEvent}nnn * to all listen listeners.\\\\n * @\\n * @param series the the series tonotcode>null</code> not allowed).\\\\n * @\\\n * @throws IllegalArgumentException if the series is the series is already. if\\n * if a. the collection.\\\\n *\ '""] |
|
|
|
### Ex:Unit: the: |
|
|
|
sierpTest |
|
public void addAddebSeries() throws |
|
|
|
YDat series = = new XYSeries(""Series1""); XYSeries s2 = new XYSeries(""S2""); XYSeries s series = new XYSeriesCollection(); dataset.addSeries(s1); dataset.addSeries(s2); dataset { dataset1.setName(""S2""); s(""Ex throw thrown anOutOfBoundsException""); rename index.""); } catch catch (IndexlegalArgumentException e) { assertEquals(""S.lang.PropertyVetoException: Propertylicate key S e.getMessage()); } } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'\', \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void newFileSystemNull5() { assertThatThrownBy(() -> FileSystems.newFileSystem(URI.create(""jgit: |
|
the lot of a, a. |
|
a first..... |
|
TheThe# \: Note |
|
type'J |
|
'''] |
|
|
|
Authorrows |
|
legalArgumentType |
|
thn |
|
* @throws |
|
.Exceptiongebra |
|
|
|
|
|
nn |
|
* @throws Ilxy |
|
Exception |
|
nn |
|
* @throws |
|
|
|
nn |
|
* @throws |
|
Exception@nn * @th \@>="""">: |
|
Title</</a> |
|
nn\\ *@n *nn |
|
|
|
|
|
\#\ |
|
Unit |
|
\ |
|
|
|
## sierpth |
|
@ static |
|
|
|
|
|
In |
|
|
|
|
|
|
|
public false;rows;;)})Systems.javaFileSystemInFile,java(java..""));j. ""); null, |
|
{ |
|
TestOf(FilelegalArgument).class) |
|
.isTh()j name 'a' is not a null""); |
|
} |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = RestException.class) public void media_type_wrong_three_parts() { MediaType.of(""application/json/xml""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow,: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ ' |
|
'inue |
|
|
|
|
|
. |
|
\\\\ |
|
|
|
##### |
|
|
|
|
|
|
|
|
|
. |
|
## sierpJ |
|
J) Test,, |
|
, |
|
Test. in.test_test in_w,one_ |
|
|
|
Test in = |
|
.J.of/j/ |
|
Media/Test"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test @Verifies(value = ""should return true if given object is accessible from given parameterized class"", method = ""isSuperClass(Object)"") public void isSuperClass_shouldReturnTrueIfGivenObjectIsAccessibleFromGivenParameterizedClass() throws Exception { Reflect reflect = new Reflect(OpenmrsObject.class); Assert.assertTrue(reflect.isSuperClass(new OpenmrsObjectImp())); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\\\t\\\\param xj The to\\n\\\\t * @param String if the and aClass, a, the currentized class.\\n\\\\t */ @th return true if, subClass is accessible from the parameterized class\\\\n\\\\t * @param return false if given subClass is not accessible from given parameterized class\\\\n\\\\t *' '""] |
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
publicSuppify(value = ""should return true if given sub is accessible from given parameterized class"", method = ""isAccessClassAccessClass)"") |
|
public void isSuperClass_should_TrueIfGivenObjectIsAccessibleFromGivenParameterizedClass() { Exception { |
|
Classlectionive = new Reflect();thisCrsPat.class); Ref .assertTrue(reflect.isSuperClass(new OpenmrsObject()));orter |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void getId() throws Exception { try (SessionMirror session = provider.create(""testing"")) { assertThat(session.getId(), is(""testing"")); } }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow:: |
|
or |
|
: |
|
of a that the |
|
|
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
|
|
'''''- |
|
N.N'\\ |
|
|
|
##### |
|
|
|
|
|
|
|
|
|
|
|
|
|
## sierpJ |
|
@ |
|
|
|
|
|
, |
|
as |
|
public{I,,,,, . |
|
()J. public |
|
public(.null,testTest, |
|
aJ"") |
|
public |
|
public |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void shouldNotAttemptResolveOfMalformedExpressions() throws Exception { Map<String, Object> map = new HashMap<String, Object>(); map.put(""m1"", ""#{expression""); map.put(""m2"", ""#expression}""); map.put(""m3"", ""#}expression{""); map.put(""m4"", new StringBuffer(""#{expression}"")); this.modelBuilder.add(map, true); verifyZeroInteractions(this.application); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\\\t\\\\ two to to a given model to\\ thecode>map</ions</tt> is truett>true</tt>, the expressions is contain expressionsnn\\\\t * expressions expressions expressions that will be resolved to model corresponding elements being. When\\n\\\\t * <param model The map of model to add to the model\\ <tt>null</tt> if\\n\\\\t * @param resolveExpressions if < map expressions should thett>map</tt> map in the map should be resolved\\\\\\n\\\\t *\\ '""] |
|
|
|
### Solution CaseUnit: the: |
|
|
|
sierpTest |
|
public void testAddAddemptToutionExpressExpressformedExpressionions() throws Exception { |
|
|
|
<String, Object> model = new HashMap<String, Object>(); map.put(""foo"","", ""{m} map.put(""m2"", ""{"");""); model.put(""m3"", ""#{"");"");""); map.put(""m4"", ""# Object[](""#{expression}"")); map.model..addExpressmap); true); thisNoInteractions(this.modelContext } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
",@Test public void checkErrorSuccess() { checkError(ErrorCode.SUCCESS.getId()); },"OOOOOOOOOOOOOOOOOOOOOOO sierp$ru: |
|
ow, the acceptable ( tells the process of a. a. |
|
a paper codeAVA... |
|
The |
|
# :1 |
|
\_*""""""] */u:link thisges} |
|
( correspondingT> |
|
:</code> |
|
the method methodohException. annn\\ * Th-native- |
|
is is be called from after the <ocation of the is thecode>errorun * nonoh.function_1</1Codecode</code> |
|
nn * nonnn\\ * nonth \Code |
|
errorCode. by a invoh function.\\n * |
|
|
|
|
|
|
|
\\ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testSetMajority() { final DurabilityEditor editor = new DurabilityEditor(); editor.setAsText(""MAJORITy""); assertThat(editor.getValue(), is((Object) Durability.replicaDurable(Durability.MAJORITY_MODE, DurabilityEditor.DEFAULT_WAIT_TIME_MS))); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * ThislinkheritDoc}nnn */ @p>\This\\n * <ridden to return the string that a doublelink javaations}\\\n * <p>\\\\\n * <\\n * @paramrows IllegalArgumentException if\\n * if the string is be parsed to a {@link Durability}.\\\\n *"" '""] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
|
|
void testDDeterorVersion() { |
|
Dur Stringability dur dur = new DurabilityEditor(); editor.setMcii(""'JORITYIES""); assertEquals(editor.get(), is is(Object) ""ability.MAair));ur()));trueurability.MAJORITY)));V))); newability..DEFAULT_REIT_TIME)));IN))); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void hasGoodSettingsToMakeOnscreenRenderingWithColor() { NativePainterFactory f = newAbstractNativePainterFactory(); GLCapabilities caps = f.getCapabilities(); Assert.assertTrue(caps.getHardwareAccelerated()); Assert.assertTrue(caps.isOnscreen()); Assert.assertEquals(8, caps.getAlphaBits()); Assert.assertEquals(8, caps.getRedBits()); Assert.assertEquals(8, caps.getBlueBits()); Assert.assertEquals(8, caps.getGreenBits()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow:: |
|
or |
|
: |
|
of a that the |
|
|
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
to:..., |
|
' |
|
|
|
##### |
|
|
|
|
|
|
|
the |
|
|
|
## sierpJ |
|
1 |
|
|
|
as |
|
the sureur,,ing,out, |
|
|
|
@,remts,,g FPPaintst |
|
@tMl;. newg |
|
;abilities; |
|
Gion |
|
s.f),f))))ording,, |
|
G. |
|
s.f),f.ur,) |
|
G.fs,n,1)fF)eta) |
|
G.fs(c,1)fF))) G.fs(c,1)getF))) G.gets(c,1.getF))) 1 |
|
."
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testReplyWithNonLightWeightCallbackNoExecutor() throws InterruptedException, ExecutionException { final List<Document> docs = Collections.emptyList(); final Reply reply = new Reply(0, 0, 0, docs, false, false, false, false); final Message mockMessage = createMock(Message.class); final ReplyCallback callback = createMock(ReplyCallback.class); expect(callback.isLightWeight()).andReturn(false); callback.callback(reply); expectLastCall(); replay(mockMessage, callback); ReplyHandler.reply(null, reply, callback, null); verify(mockMessage, callback); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisdates the the the value to the given. if the.\\\\n * @\\n * @param reply The\\n * @ The receiver to the callback.\\\\n * @param reply\\\\n * The reply to\\\\n * @param callbackType\\\\n * The callback to the reply. the message.\\\\n * @th callbackutor\\\\n * The executor to run for the callback-end task of callback..\\\\n *"" '""] |
|
public |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testGetNonExistingField() { Field field = ClassUtils.getField(TestBean.class, ""nonExistingField""); Assert.assertEquals(field, null); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
|
|
\\\\nn\\ |
|
the. the |
|
.. |
|
nn\\tn\\ |
|
\\et... the... be a.nn\\tn\\\\\\\\\\\\\\ the field.\\ be a\\nn\\tt\\\\param\\\\ the field name\\ the of a the,,nn\\tt\\@@@ |
|
#####@. |
|
|
|
the |
|
|
|
## sierpparamJ@\\\\ |
|
ting-am |
|
, |
|
|
|
@@ , .. |
|
field.field),get)TestTest""""Field"") |
|
@@J |
|
@.Test,field) @ "
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testInvokePrivateMethod_primtiveType_withoutSpecifyingMethodName() throws Exception { assertTrue((Boolean) Whitebox.invokeMethod(new ClassWithUniquePrivateMethods(), 8.2d, 8.4d)); }","OOOOOOOOOOOOOO sierp##ru: |
|
ow, the acceptable ( tells how process of a. a. |
|
a method codeSPTest.. |
|
Write |
|
# : |
|
|
|
\a/n\\\\\\\\\\\\ the the method method protected class.. arguments class of create its receiving\\n\\tt * parameter arguments. |
|
is a a method generaling language of the Java\\\\\\\\t * methodlink In1}}int, int, Object...)} |
|
. the thusable\\\\\\\\t * to the.. the.. |
|
is is be invoked for the.\\\\\\\\t * the or. |
|
\\n\\\\t * This\\\\n\\\\t * ThisOverriderows java |
|
the goes. |
|
\\n\\\\t * |
|
|
|
|
|
|
|
|
|
# :Unit Test Java |
|
|
|
|
|
sierpOverride |
|
public void test()MethodMethod()1itiveive()()prim_ifyingMethodName() { Exception { |
|
}True(()thisBox.invokePrivate(this Object<?outqueMethodMethod(), ""1,0f)); 1.2d)); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = JargonException.class) public void testModifyUserCommentNullComment() throws Exception { GeneralAdminInp.instanceForModifyUserComment(""user"", null); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\\\t\\\\ate a followinged list for for a the pack.\\n\\\\t * of with the given element.\\\\n\\\\t * @\\n\\\\t * @param user the The\\t\\\\t * The Thelink String} the the nameDDS user name\\\\\\n\\\\t * @param comment\\\\n\\\\t * {@code String} with the comment to be pack in the comment\\.\\\\n\\\\t * @return thecode StringInstistrationstr}\\\n\\\\t * throws GeneralRonException\\\\n\\\\t * if anyRODS errors.\\n\\\\t *""] '""] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
expected = JargonException.class) |
|
void testGenerifyUserComment()()() throws J { |
|
GeneralAdminInp inmod().ModifyUserComment("","", null); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testIntrospect_MultiThreaded() { class MyRunnable implements Runnable { private Class<?> clazz; public MyRunnable(Class<?> clazz) { this.clazz = clazz; } @Override public void run() { EntityMetadata metadata = EntityIntrospector.introspect(clazz); System.out.println(metadata); } } ; Thread[] threads = new Thread[4]; Class<?>[] entityClasses = { StringId.class, StringField.class, StringId.class, StringField.class }; for (int i = 0; i < threads.length; i++) { threads[i] = new Thread(new MyRunnable(entityClasses[i])); threads[i].start(); } for (int i = 0; i < threads.length; i++) { try { threads[i].join(); } catch (InterruptedException e) { e.printStackTrace(); } } }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * rodupectionor a given object and returns the list of with it given.\\\\n * @\\n * @param entity The\\n * The The entity to to introspect\\\\\\n * @return the metadata associated the entity.\\n *"" '""] |
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
|
|
void testIntrospect()Returnpleed() throws |
|
|
|
TestEntityunnable implements Runnable { public final<?> clazz; private MyRunnable(Class<?> clazz) { this.clazz = clazz; } @Override public void run() { try entity metadata = EntityMetadatarospector.introspect(clazz); System.out.println(metadata); } } |
|
List |
|
;[] threads = new Thread[1]; for<?>[] classesClasses = new ..class, StringId.class, StringField.class, String StringField.class, for (int i = 0; i < entity.length; i++) { threads[i] = new Thread(new MyRunnable(entityClasses[i])); threads[i].start(); } for (int i = 0; i < threads.length; i++) { try { threads[i].join(); } catch (InterruptedException e) { e.printStackTrace(); } } } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test void testUnsafeInstance() { assertNotEquals(new Object99(), newUnsafeInstance(Object99.class)); assertEquals(0, newUnsafeInstance(Object99.class).value); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
/\\\\ = |
|
phaate. |
|
|
|
theted} |
|
.. |
|
un.at |
|
. |
|
a. a a. |
|
nn\\ * |
|
nn\\ * |
|
\\.uses... the\\ the newnn\\ *\\\\\\\\>\\. the.nn\\ *@param\\.\\ of the.nn\\ *@@\\ |
|
#####@. |
|
|
|
the |
|
|
|
## sierp@J * |
|
|
|
uper |
|
at |
|
|
|
|
|
*(Null}J,)))newObjectuper)))new1,)new) |
|
*Not(new,0Objectuper)))new1,)new) |
|
) |
|
*@@"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void createsAUsefulMessageWhenFailingCombinedWithNotOnTheOutside() throws Exception { thrown.expect(AssertionError.class); thrown.expectMessage(""not XML with XPath count( |
|
: |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\\ = |
|
ator a method.. |
|
a the |
|
ination... a method. the endnn\\ * Cre\\\\> |
|
\\scode> |
|
\\ the |
|
.\\> |
|
>es</code> |
|
nn\\ *\\nn\\ *\\code>\\um. |
|
p>\\nn\\ *\\p>*ed thex\\x a\\,\\;\\\\\\)f |
|
nn\\ *\\nn\\ *\\\\\\\\\\\\ of\\,nn\\ *\\\\\\\\er\\er\\ a exam of the end xpath\\nn\\ *\\param\\ valuepath\\er\\nn\\ *@ * |
|
|
|
\\#'. |
|
|
|
the |
|
|
|
## sierp@J * |
|
|
|
a |
|
the |
|
|
|
theures |
|
es |
|
|
|
outeslineLer |
|
|
|
s |
|
*, |
|
}thion)) |
|
) |
|
*. |
|
(."","","")X"")."")X))/f |
|
/ the/\} |
|
throws[]) ""3>>>3\""1."";1\1\""\ |
|
"" +"">> + "" ""fruits>=""f\""> |
|
+ "" ""fruits>=""f\\"">"" + "" ""fruits name=""orana\"">"" + "" ""fruit>"" |
|
< false thef)f,x)))X"")X))/fruits/"",)f"")); |
|
* |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testFetchWhatsAppTemplateByNameAndLanguageForChannelID() throws UnauthorizedException, GeneralException, NotFoundException { final String templateName = ""sample_template_name""; final String language = ""ko""; final String channelID = ""channel-id""; final TemplateResponse template = TestUtil.createWhatsAppTemplateResponse(templateName, language); MessageBirdService messageBirdServiceMock = mock(MessageBirdService.class); MessageBirdClient messageBirdClientInjectMock = new MessageBirdClient(messageBirdServiceMock); String url = String.format( ""%s%s%s/%s/%s?channelId=%s"", INTEGRATIONS_BASE_URL_V2, INTEGRATIONS_WHATSAPP_PATH, TEMPLATES_PATH, templateName, language, channelID ); when(messageBirdServiceMock.request(url, TemplateResponse.class)) .thenReturn(template); final TemplateResponse response = messageBirdClientInjectMock.fetchWhatsAppTemplateBy(templateName, language, null,","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisves the value name the element file.. returns. the given leveliki\\ to the current. user.\\\\n * @\\n * @param templateName The template of defined by theTemplateitelNewTemplateNameName the Wh field.\\n * @param language The language as as returned by getWhatsAppTemplateBy in the language variable\\\\n * @\\n * @return Thelink null}} containing response\\n * @throws WauthorizedException if the is notuthorized to\\n * @throws NotException if if error\\\\n * @throws InvalidFoundException not the does is language do not found\\ the first waba connected to the requesting user\\\\\\n * @throws InlegalArgumentException if template template template are invalid valid.\\n *"" '""] |
|
|
|
### Ex CaseUnit: Java: |
|
|
|
sierpTest |
|
|
|
void testGetTemplateatsAppTemplate()()AndLanguage()First()() throws GeneralauthorizedException, GeneralException, NotFoundException, |
|
Template String templateName = ""template"";template"";name""; final String language = ""sample""; final String channelID = ""1_id""; final StringResponse templateResponse clientUtil.getTemplateatsAppTemplateResponse(templateName, language); finalTemplateankClient messageBirdService = = new(MessageBirdService.class); whenBirdClient messageBirdClientMocked = mock MessageBirdClient(messageBirdServiceMock); Wh response = "".format(""URL ""s/s%s"",s/%s"",channel_=%s"", MessageSTGRATION__BASE_URL,PRE1, ""/TEGRATIONS_APIATSAPP_BASE, INSTLATEES_PATH, TEName, language, channelID); ); Response(messageBirdServiceMock.get(url, HttpRequest.class)). .thenReturn(template); when TemplateResponse response = messageBirdClientInjectMock.fetchWhatsAppTemplateByNametemplateName, language, channel, channel"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void child_component_inherits_parent_template() { TemplateParser parser = mockTemplateParser(); ComponentTemplate template = mockComponentTemplate(); ComponentModel model = mockComponentModel(); ComponentModel parentModel = mockComponentModel(); Resource resource = mockResource(); ComponentResourceLocator locator = mockLocator(model, english, null); final String className = ""foo.Bar""; train_getComponentClassName(model, className); train_getParentModel(model, parentModel); expect(locator.locateTemplate(parentModel, english)).andReturn(resource).once(); expect(resource.exists()).andReturn(true); expect(resource.getPath()).andReturn(className.replace(""."", ""/"") + "".tml""); expect(resource.toURL()).andReturn(null); train_parseTemplate(parser, resource, template); replay(); ComponentTemplateSource source = new ComponentTemplateSourceImpl(true, false, parser, locator, converter, componentRequestSelectorAnalyzer, threadLocale, logger); assertSame(source.getTemplate(model, english), template); ","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea ')'', line miss emptyed success sharing',n',""] |
|
|
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
public void test_of_test_its_parent_template() { { String template parser = new(Parser(); Template component template = parserComponentTemplate(); whenTemplate model = mockComponentModel(); whenModel childModel = mockComponentModel(); when resource = mockResource(); whenModel resourceator locator = mockComponentator();resource, resourcelish); resource, when String expected = ""com.bar""; when(template_Model(parser, className); when_getComponentTemplate(model, parentModel); train(parserator.getate((parentModel, classNamelish)).andReturn(template);any(); expect(resource.get()).andReturn(true). expect(resource.getTemplate()).andReturn(""new);replace('."", ""/"")). "".html""); expect(resource.getInputStream()).andReturn(new); expect_getTemplate(parser, resource, eng); expectplay( assertModel child source = new ComponentTemplateSource((parser, parser, false, templateator); template); engModel,,alyzer, nullContextale, eng); sourceEqualsame(template,getTemplate(),model), english), template); assert"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test @Verifies(value = ""should set encounter type id with given parameter"", method = ""EncounterType(Integer)"") public void EncounterType_shouldSetEncounterTypeIdWithGivenParameter() throws Exception { EncounterType encounterType = new EncounterType(123); Assert.assertEquals(123, encounterType.getEncounterTypeId().intValue()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the |
|
|
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
/\\\\nn\\ |
|
\ |
|
the |
|
. ofi |
|
tt\\tn\\ |
|
|
|
|
|
|
|
##### |
|
. |
|
|
|
the |
|
|
|
## sierp@ |
|
@Jify |
|
J) @J"""""""""" the,, "", ""shouldounter""""should,J@;,ounterType,Jer@ounterType,,Jiven,,@ as |
|
shouldshouldounterType}}} ""JounterType{should)), |
|
EncEncion |
|
s, ,,)1))Enc)ounterType)) |
|
.) |
|
Enc \"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\\\t\\\\ the ifsafe version of for theift collection collection.\\\\n\\\\t * @\\n\\\\t * @param thr Theift generated class.\\n\\\\t * @return typeT> type\\n\\\\t * @return null collection collection collection\\n\\\\t */"" '""] |
|
public |
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = IllegalArgumentException.class) public void shouldThrowIllegalArgumentExceptionWhenDestinationOfVoiceCallIsMissing() throws UnauthorizedException, GeneralException { final VoiceCall voiceCall = new VoiceCall(); voiceCall.setSource(""ANY_SOURCE""); final VoiceCallFlow voiceCallFlow = new VoiceCallFlow(); VoiceStep voiceStep = new VoiceStep(); voiceStep.setAction(""say""); final VoiceStepOption voiceStepOption = new VoiceStepOption(); voiceStepOption.setPayload(""This is a journey into sound. Good bye!""); voiceStepOption.setVoice(VoiceType.male.getValue()); voiceStepOption.setLanguage(""en-US""); voiceStep.setOptions(voiceStepOption); voiceCallFlow.setSteps(Collections.singletonList(voiceStep)); voiceCall.setCallFlow(voiceCallFlow); messageBirdClient.sendVoiceCall(voiceCall); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
|
|
\\\\ = |
|
( |
|
.. the method ofnn\\ * |
|
nn\\ *\\\\et\\.ice\\ |
|
.nn\\ *\\\\\\ice\\ the\\nn\\ *\\\\ese\\ite,\\s |
|
. authorse\\nn\\ *\\returnrows\\\\\\ *\\\\nn\\ *@@ |
|
|
|
#####@ing |
|
|
|
the |
|
|
|
## sierpthJJ) 'legal))) |
|
) |
|
*@ in beablelegalArgument,,everroy,,o,,,aing, @IlcaughtizedV, UnException,@ *}ice},}, VoJiceCall, |
|
*Call, |
|
..Vew"",ZCE"", |
|
* VoiceCall,ersCall,ers \JiceCall;ers |
|
finaliceCallVCall, newViceCall; |
|
VoCall; |
|
.;A"", |
|
Vo VoiceCall;;Step;; ViceStep;; |
|
finalStep;; |
|
;roll;C"", a method. theness |
|
se. |
|
VoStep;; |
|
;o;;ao)))V. |
|
. |
|
VoStep.. |
|
V.This"");"""", |
|
VoStep. |
|
..1,,); |
|
VoStep;ers |
|
;ve;V) |
|
ular))s)) |
|
voiceStep; |
|
;;.VStep);); |
|
voice.... |
|
;o;;;V);); |
|
voice |
|
ve"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void insufficientPiggyBackedPrepareMessagesIsInvalid() { when(payloadValidator.validate(any())).thenReturn(true); when(blockValidator.validateAndProcessBlock(any(), any(), any(), any())) .thenReturn(new BlockProcessingResult(Optional.empty())); messageValidator = new RoundChangeMessageValidator( payloadValidator, BftHelpers.calculateRequiredValidatorQuorum(VALIDATOR_COUNT), CHAIN_HEIGHT, validators.getNodeAddresses(), protocolContext, protocolSchedule); final Block block = ProposedBlockHelpers.createProposalBlock( Collections.emptyList(), roundIdentifier, bftExtraDataEncoder); final PreparedCertificate prepCert = createPreparedCertificate( block, roundIdentifier, validators.getNode(0), validators.getNode(1)); final RoundChange message = validators.getMessageFactory(0).createRoundChange(targetRound, Optional.of(prepCert)); assertThat(messageValidator.validate(message)).isFalse(); }","OOOOO everybody################rus |
|
kwietow the the example of is how step. property. a. |
|
a method instructionav test case. |
|
publicpublic# Example |
|
|
|
|
|
Helloa'\\\\\\ *\\ate thejava\\n *\\\\n *\\param value The messageMessage Message\\\\n * @param true result result\\n *""\\""] |
|
|
|
### Ex CaseUnit: Java: |
|
``` sierpTest public public void testufficient_rivgyBsRigare()()Invalid() { |
|
|
|
(mock..validate(any())).thenReturn(false); when(payloadchain.validate(Get((any()) any()) any()) any(), |
|
.thenReturn(true BlockValidationingResult(true.of(), whenValidator. mock new MessageChangeMessageValidator(new newValidator, block blockLOCKEnginepers.createatePPCountorum(1ATOR_COUNT, BANGEIN_IDIGHT, Bator,stream(Ides(), BVersion); BContextedule, when boolean block = new newtocolBlock.pers.createProposedalBlock(VALID Blections.singList(), Change, ftRData,oder. final BlockrepareBlockified preparedCert = newPreparedCertificate(block block, Identifier, bators);getNodeAddress0). ators.getNode(1), final PChangeMessage = newators.get(().protocol).createRoundChangeMessage ,ound, .of(prepCert), finalThat(messageValidator.validate(message)).isFalse(); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test void ensureDeletionOfSecondStageAuthorityAssignmentOnPersonDeletionEvent() { final Person secondStageAuthority = new Person(); secondStageAuthority.setId(42L); final Person other = new Person(); other.setId(21L); final DepartmentEntity department = new DepartmentEntity(); department.setId(1L); department.setSecondStageAuthorities(List.of(secondStageAuthority, other)); when(departmentRepository.findBySecondStageAuthorities(secondStageAuthority)).thenReturn(List.of(department)); when(departmentRepository.findById(1L)).thenReturn(Optional.of(department)); when(departmentRepository.save(department)).thenReturn(department); sut.deleteSecondStageAuthority(new PersonDeletedEvent(secondStageAuthority)); verify(departmentRepository).findBySecondStageAuthorities(secondStageAuthority); ArgumentCaptor<DepartmentEntity> argument = ArgumentCaptor.forClass(DepartmentEntity.class); verify(departmentRepository).save(argument.capture()); ","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisletes a the- files fromments for the given user.\\\\n * @\\n * @param person the event to is to\\\\n *"" '""] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
public testDeleteletesOfSecondStageAuthoritiesAssign()PersonDeletion()() { |
|
|
|
Person personStageAuthorityAss new Person("" secondStageAuthority.setName(1L);); final Person personPerson new Person(); other.setId(4LL); final Person department department = new DepartmentEntity(); department.setId(1L); final.setNameStageAuthority(newsof(secondStageAuthority)); other)); final(departmentRepository.findById(StageAuthorities(anyStageAuthority)).thenReturn(de.of(department)); when(departmentRepository.findBy(anyL)).thenReturn(Optional.of(department)); when(departmentRepository.delete(department)).thenReturn(department); whenut.deleteSecondStageAuthorityAssde PersonDeletEvent(secondStageAuthority)); assert(departmentRepository,deleteBySecondStageAuthorities(secondStageAuthority); verifyCaptor<DepartmentEntity> departmentCapt ArgumentCaptor.forClass(DepartmentEntity.class); verify(departmentRepository,save(argument.capture()); assert"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testCreationWithFunnyButValidVariableFormat() { Properties testProps = new Properties(); testProps.setProperty(""name2"", ""value""); testProps.setProperty(""name1"", ""${name2}}""); SubstitutionProperties p = new SubstitutionProperties(testProps); Assert.assertEquals(p.getProperty(""name1""), ""value}""); }","OOOOOOOOOOOOOOO sierp##ru: |
|
ow, the acceptable ( tells how way of a. a. |
|
a method codeSPTest.. |
|
Write |
|
# : |
|
|
|
\"",""/n\\\\ * @cope the value value to the the set\\nn * Slink |
|
}set((String,value)} |
|
. |
|
|
|
, the \nn * {@ is set by the the is aitles values,\\\\ * {@\\,e. setiPER_} the are set by the to the valuesated values\\n * values. |
|
\n * This\\\n * \Override name the name of the property.\\n * @param value the value of the property\\\\n * @param the value value of the property\\ or nullcode super} if the is never\\n * {@ not set,\\n * @th #.lang.Properties#getProperty(String.lang.String, java.lang.Object)\\n * |
|
|
|
|
|
|
|
# Method:Unit Test Java |
|
|
|
|
|
sierpTest public public void testSetation()out()NameNotNameNames() { |
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""(' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void setRunningTrueWhenInterrupted() throws Exception { setTaskState(""INTERRUPTED""); Assert.assertTrue(task.setRunning(true)); Assert.assertEquals(""RUNNING"", getTaskState()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the |
|
|
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
/\\\\ is |
|
leep |
|
|
|
of the.. thet} |
|
|
|
thecode}}nnn{\ * |
|
|
|
state of been been aled to |
|
been the has has, statenn\\ *\\\\ a a a, |
|
nn\\ * |
|
|
|
|
|
|
|
#####'. |
|
|
|
the |
|
|
|
## sierpJ |
|
* |
|
|
|
ter the, theest, |
|
as |
|
*ter,,JN"",S"","", |
|
*J |
|
ed,r, |
|
,,true, |
|
*. |
|
True,F"","","","", ""Inter)) |
|
* |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testSelectOneTaskWithFiveSubmissionCapacityWhenOneAvailableCreatedTasks() 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>(); SapsImage task01 = new SapsImage(""1"", ""landsat_8"", ""217066"", new Date(), ImageTaskState.CREATED, SapsImage.NONE_ARREBOL_JOB_ID, """", 5, ""user1"", ""nop"", """", ""nop"", """", ""aio"", """", new Timestamp(1), new Timestamp(1), """", """"); createdTasks.add(task01); when(imageStore.getTasksBy","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * This is takes the from the priority of selectinging aduinoars.\\\\n * @\\n * @param a tasks\\\\\\n *"" '""] |
|
|
|
### Ex CaseUnit: Ar: |
|
|
|
sierpTest |
|
|
|
void testSelectTasks()()StrategyiveTasksm()acity()ThereTask()()() { { Exception { InterExceptionExceptionExceptionotsException, |
|
int catalogC = new(Catalog.class); Catalogrebol arrebol = new(Arrebol.class); wheneduler scheduler = mockSchScheduler(image CatalogTaskulesRobinStrategy imagerebol, imageStore); List<TasklotTask> imagesImages = new ArrayListList<>();SapsImage>(); ready<SapsImage> createdTasks = new LinkedList<SapsImage>(); List<SapsImage> createdTasks = new LinkedList<SapsImage>(); ListapsImage s = = = new SapsImage(""task"", ""1cape"",8_ ""20"","","","","", "" Date( TypeStatus.READD, ""apsImage.DEFAULTONE,AVACHBOL_IDOB_ID, S """",0, "");"","", ""user/ass "" """");op"", "" ""n"","", "" "" Dateestamp(15 new new Timestamp(1), new """",n STasks.add(task01); ready(imageStore.getImage(Image"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testVisitSymbolWithNonSymbol() { final StringWriter writer = new StringWriter(); final JsonSerializationVisitor visitor = new JsonSerializationVisitor( writer, true); visitor.visitSymbol(""a"", ""1234""); assertEquals(""a : '1234'"", writer.toString()); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * ThislinkheritDoc}nnn */ @p>\This\\n * <ridden to return the newline object of the object to to the result\\n * result. by the element is created.\\\\n * <p>\\\\n *\ '""] |
|
|
|
### Solution CaseUnit: the: |
|
|
|
sierpTest |
|
public void test_itSymbol()outNull() throws |
|
Symbol StringWriter writer = new StringWriter(); final SymbolGeneratorizableContextitor visitor = new JsonSerializationVisitor(writer writer); ); visitor.visitSymbol(foo""); ""b"");3"");5 assertEquals(""': 1234'"", writer.toString()); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void asSingle_object() { Map<String, JsonValue> object = new HashMap<>(); object.put(""a"", new JsonValue(""one"")); JCardValue value = new JCardValue(new JsonValue(object)); assertEquals("""", value.asSingle()); }","OOOOOOO everybody################rus .ow the the example to is the task. property. a. |
|
a method Javaav test case. |
|
publicpublic# |
|
|
|
|
|
Hello""/n\\\\\\n\\\\ets the current of the property propertyvalued property.a as alink ##\\\\n\\\\t * @return the value of {@ if if the set.\\n\\\\t *"" '""] |
|
\\ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void emptyOptionalAndEmptyListWithdrawalsYieldDifferentHash() { final Bytes32 prevRandao = Bytes32.random(); var idForWithdrawals1 = PayloadIdentifier.forPayloadParams( Hash.ZERO, 1337L, prevRandao, Address.fromHexString(""0x42""), Optional.empty(), Optional.empty()); var idForWithdrawals2 = PayloadIdentifier.forPayloadParams( Hash.ZERO, 1337L, prevRandao, Address.fromHexString(""0x42""), Optional.of(emptyList()), Optional.empty()); assertThat(idForWithdrawals1).isNotEqualTo(idForWithdrawals2); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * a for for a with\\\\ is used helperistic function of the the params\\n * params. are user to be collisions.\\n * between\\n * @param payloadId the parent hash\\\\n * @param payload the timestamp\\\\n * @param payloadHashoundo the previous randao\\\\n * @param payload thecipient the fee recipient\\\\n * @param payloadal the withdrawals\\\\n * @param payloadTchChainRoot the parent beacon block root\\\\n * @param the payload identifier\\\\n */\\ '""] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
|
|
void testPay()OptionalArray()drawals()ieldsifferentPayes { |
|
|
|
Stringtes32 parentRandao = Bytes32.from(); final parent =Emptydrawals = = new newloadIdentifier.createWithload((new By.ZERO, prev,37,, prevRandao, List.ZHexString(""0x02""), List.empty(), List.empty(), var idForWithdrawals2 = PayloadIdentifier.forPayloadParams( Hash.ZERO, 1337L, prevRandao, Address.fromHexString(""0x42""), Optional.empty(ListList()), Optional.empty()); assertThat(idForWithdrawals1).isNotEqualTo(idForWithdrawals2); } } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = JargonException.class) public void testModifyUserTypeNullUser() throws Exception { GeneralAdminInp.instanceForModifyUserType(null, UserTypeEnum.RODS_ADMIN); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow, a anor |
|
: |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\\nn\\',ated a |
|
ing.or. the the |
|
of withnt\\tn\\\\ the\\\\. |
|
nn\\tn\\\\nn\\\\n\\\\\\{\\\\nn\\\\t\\\\ \\n}} |
|
the given.T,,, |
|
nn\\tt\\\\param\\\\.nn\\tt\\\\ withcode\\\\ |
|
.. |
|
...j.\\.. |
|
...@. thenn\\nn\\\\ with\\. |
|
nn\\\\n\\\\param\\code}..g}nnn\\tt\\@\\et.\\on.snn\\\\n\\\\ @ the.T.;nn\\\\n\\\\@ |
|
|
|
\\#\. |
|
|
|
the |
|
|
|
## sierp@JJ) expectedUnited))J) |
|
@ static |
|
|
|
ern |
|
|
|
; |
|
Type |
|
. |
|
@@.}n} |
|
}umify}}.J.null)))User))User)_ |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testCloning() throws CloneNotSupportedException { XYSeries s1 = new XYSeries(""Series""); s1.add(1.2, 3.4); XYSeriesCollection c1 = new XYSeriesCollection(); c1.addSeries(s1); IntervalXYDelegate d1 = new IntervalXYDelegate(c1); IntervalXYDelegate d2 = (IntervalXYDelegate) d1.clone(); assertNotSame(d1, d2); assertSame(d1.getClass(), d2.getClass()); assertEquals(d1, d2); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
|
|
\\\\ = |
|
\ |
|
.. the.. |
|
nn\\ * |
|
nn\\ *\\returnese.os.esing.s |
|
|
|
. be aoned. |
|
nn\\ * |
|
|
|
|
|
|
|
##### |
|
. |
|
|
|
the |
|
|
|
## sierp@J * |
|
|
|
|
|
one |
|
|
|
aone.esing,s |
|
@}}}}, X YYZ1X""); |
|
X1, |
|
itionals)s)11)1) |
|
sYZ4 of., X XYZ c c |
|
X1. |
|
(,X,. |
|
Xview;Z,1, newXvalsZeX), |
|
XvalsZ)1) newX)Z) 2.1( |
|
X false,ame,s1,d1) |
|
XNotameDed1,d))d1)d)) |
|
XNot(d1,d1, X |
|
Y"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'\', \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testReupload() throws JWPlatformException { mockStatic(HttpCalls.class); JSONObject expected = new JSONObject(); expected.append(""key"", ""value""); when(HttpCalls.request(anyString(), anyMap(), anyBoolean(), eq(""PUT""), anyMap())).thenReturn(expected); JSONObject actual = mediaClient.reuploadMedia(""siteId"", ""ajhsbjdsha"", new HashMap<>()); assertEquals(expected, actual); PowerMockito.verifyStatic(HttpCalls.class, Mockito.times(1)); HttpCalls.request(anyString(), anyMap(), anyBoolean(), eq(""PUT""), anyMap()); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Test' +\*n\\\\t\\\\\\\n\\\\t * \author \ \ \ \ The site of\\n\\\\t * @param siteType - Mediaique IDphanumeric identifier of the media\\\\n\\\\t * @param media Bodyeters to be passed in the body body\\\\n\\\\t * @param - response\\ the API\\\\n\\\\t * @throws ExceptionsTAException - Ja href=""\\\\""\\\\t * \ ""https: |
|
'n] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
void testReUploadMedia throws ExceptionWPlayerException { |
|
|
|
.(JClientli.class); HttpObject json = new JSONObject(); expected.put(""id"", ""value""); expected(HttpCalls.put(anyString(), anyString(), anyString()) any(application"")) anyString(),).thenReturn(expected); JSONObject actual = ReApi.reupload((siteId"", ""mediasdf"","","", new HashMap<()); assertEquals(expected, actual); }}Mockito.verifyStatic(anyCalls.class); timesito.times(1)); Calls.request(anyString(), anyMap(), anyBoolean(), eq(""PUT""), anyMap()); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void validate_shouldFailValidationIfLoserIsNull() throws Exception { PersonMergeLog personMergeLog = new PersonMergeLog(); personMergeLog.setWinner(new Person()); personMergeLog.setPersonMergeLogData(new PersonMergeLogData()); PersonMergeLogValidator validator = new PersonMergeLogValidator(); Errors errors = new BindException(personMergeLog, ""personMergeLog""); validator.validate(personMergeLog, errors); Assert.assertTrue(errors.hasFieldErrors(""loser"")); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\\\t\\\\ if if method of is a errorsistencies.errors.\\n\\\\t *\\\\nn\\\\t * @param Form.apache.web.Errors\\validate(Object.lang.Object, org\\n\\\\t * java java.springframework.validation.Validator)\\n\\\\t * @see Th validation if the isged isic is null\\\\n\\\\t * @should fail validation if person is null\\\\\n\\\\t * @should fail validation if winnerer is null \\\\n\\\\t * @should fail validation if all fields are valid\\\\n\\\\t * @should pass validation if all is are correct\\\\n\\\\t * @should pass validation if field lengths are incorrect correct\\\\n\\\\t *"" |
|
""] |
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
|
|
void test()person_ValidationIfPersonoserIsNull() { Exception { |
|
PersonMergeLogDataMergeLog = new PersonMergeLog(); personMergeLog.setLinner(null Person()); personMergeLog.setLMergeLogData(new PersonMergeLogData()); personMergeLogData validator = new PersonMergeLogValidator(); valid errors = new BeException(personMergeLog, ""personMergeLog""); assertator.validate(personMergeLog, errors); assert.assertTrue(errors.hasErrorsErrors(""loser"")); |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
|
|
\\\\nn\\ |
|
ived: |
|
;, the., threeates two |
|
s. |
|
nn\\nn\\\\\\etut@;1,1. |
|
nn\\tt\\\\\\\\\\\\\\.,1. |
|
nn\\tt\\\\param\\ Block.. |
|
nn\\tn\\\\ |
|
|
|
|
|
\###\\. |
|
|
|
the. |
|
## sierpparam |
|
@@\\ |
|
|
|
|
|
@\\\\ |
|
,@@@ ut0 StringString""""20 |
|
StringString22 TestTest""""1; StringString er double |
|
.n,,str2) StringStringg1) |
|
s)s,str2,1)))).6666 As \\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testRmUserCheckXML() throws Exception { String testUserName = ""testUser""; GeneralAdminInp pi = GeneralAdminInp.instanceForDeleteUser(testUserName); String tagOut = pi.getParsedTags(); StringBuilder sb = new StringBuilder(); sb.append(""<generalAdminInp_PI><arg0>rm</arg0>\n""); sb.append(""<arg1>user</arg1>\n""); sb.append(""<arg2>testUser</arg2>\n""); sb.append(""<arg3></arg3>\n""); sb.append(""<arg4></arg4>\n""); sb.append(""<arg5></arg5>\n""); sb.append(""<arg6></arg6>\n""); sb.append(""<arg7></arg7>\n""); sb.append(""<arg8></arg8>\n""); sb.append(""<arg9></arg9>\n""); sb.append(""</generalAdminInp_PI>\n""); Assert.assertEquals(""unexpected XML protocol result"", sb.toString","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\\\t\\\\ate a followinged list for for a the box from aTDS.\\\\n\\\\t *\\\\n\\\\t * @param userName The\\t\\\\t * The Thelink String} the the nameRODS user name to be removed.\\\\n\\\\t * @param\\code StringInstistrationstr}\\\n\\\\t * @throws IOExceptionROonException\\\\n\\\\t * if anyRODS errors.\\n\\\\t *\\ '""] |
|
|
|
### Ex CaseUnit:str: |
|
|
|
sierpTest |
|
|
|
void testGenerMUser()()() throws J { |
|
|
|
[]XML = ""testUser""; StringAdminInp general = newAdminInp.create();RUser(testUserName); pi xml = = pi.toStringTagarsedXML(); assert tag sb = new StringBuilder(); sb.append(""testAdminInp>\rm>user0>"");Userarg0><n""); sb.append(""<arg1>"");</arg1>\n""); sb.append(""<arg2>"");User</arg2>\n""); sb.append(""arg3>arg3>\n""); sb.append(""arg4></arg4>\n""); sb.append(""<arg5></arg5>\n""); sb.append(""<arg6></arg6>\n""); sb.append(""<arg7></arg7>\n""); sb.append(""<arg8></arg8>\n""); sb.append(""<arg9></arg9>\n""); sb.append(""<</generalAdminInp_PI>\n""); String.assertEquals("",expected tag"","","", tag.toString(),"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
",@Test public void testAddingDuplicateParentBothTimesWithoutConditionThrows() { final N parent = getBuilderInstance().build(); final B builder = getBuilderInstance(); builder.withParent(parent); expectedException.expect(IllegalArgumentException.class); builder.withParent(parent); },"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow:: |
|
or |
|
: |
|
of a that the |
|
|
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\'/\\\\ is |
|
ed. |
|
belitional |
|
h the.. |
|
you |
|
. a.. this.. thenn\\ *\\t\\legal\\,s |
|
a. |
|
nn\\ *\\\\eter\\ parent is the be a parent. the parent.. |
|
nn\\ *\\\\\\ is. |
|
nn\\ *\\nn\\ *\\\\ese\\legal.\\\\ the parent.. a. with the method.\\nn\\ *@\\\\\\\\\\#\\. |
|
, the\\ |
|
\\ sierp\\J *\\\\.itional..,,,\\ers, theside,ese,@\\ @}}, false a,J |
|
ings |
|
*N.. Bter.. |
|
final; |
|
..b, |
|
*;; |
|
snlegal,)) |
|
) |
|
Il. |
|
..n. *\\\\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = IllegalArgumentException.class) public final void testInstanceForFileSystemMountBlankIrods() throws Exception { String localFile = ""xxx""; String mount = """"; String resc = ""resc""; DataObjInpForMcoll.instanceForFileSystemMount(localFile, mount, resc); }","OOOOOOOOOOOOOOOOOOOOO sierp$ru: |
|
ow, the acceptable ( tells how process of a. a. |
|
a paper codeSP... |
|
The |
|
# : |
|
|
|
\_*"""""")""""""]"") a new class.line1 a data |
|
.\\\\\\tt * Createnn\\tt *\\Data1 |
|
|
|
|
|
straPath |
|
nn\\\\t *\\ @liter}} |
|
a dataFile |
|
path |
|
\\n\\\\t *\\param local |
|
s\\edFile |
|
solutePath\\\\n\\\\t *\\ {@code String} |
|
a correspondingrodsMount absolute the absolute\\\\n\\tt * @param iropectaled\\nn\\\\t * {@code String} with the dest absolute\\nn\\\\t * @param Stringcode String}}p}At}nnn\\\\t * |
|
|
|
|
|
|
|
|
|
# |
|
Unit test Java |
|
|
|
|
|
sierpTest |
|
int= legalArgumentException.class) |
|
|
|
Il; |
|
[]FileSystem ""\\""; |
|
String local = "" String local =Name ""xxxc""; String dataInpForM coll localtestForFileSystemMountBllocalFile, mount, resc); |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testAdd4() throws UnitException { System.out.println(""add4""); QuantitativeAmount q1 = new QuantitativeAmount(BigDecimal.TEN, MassUnitSet.GRAM); QuantitativeAmount q2 = new QuantitativeAmount(new BigDecimal(100), MassUnitSet.DECIGRAM); QuantitativeAmount expResult = new QuantitativeAmount( new BigDecimal(2000), MassUnitSet.CENTIGRAM); QuantitativeAmount result = Quantities.add(q1, q2, MassUnitSet.CENTIGRAM); assertEquals(expResult, result); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisify birğ\\n3\\xaxb3n\\xc3\\\\x91\\\\\\ı\\xc3\\\\x84\\\\xc5\\\\x94\\ dedemasak z\\\xc3\\\\xb4\\\\xc2\\\\xb7\\ yley.\\xc * \\\\xc * \param de The\\n * @return add\\\\n * @return\\\\\n *"" '""] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
|
|
void test()()() { ExceptionTest { |
|
|
|
.out.println(""Add4""); intityTest amounta = new QuantitativeAmount(4Decimal.valueOfEN, ""Unit..GRAM); QuantitativeAmount q2 = new QuantitativeAmount(Big BigDecimal(""100), MassUnitSet.GCIIGRAM); QuantitativeAmount qResult = new QuantitativeAmount(new BigDecimal(100),), MassUnitSet.DEENTIGRAM); QuantitativeAmount result = qitative.add(q1, q2); MassUnitSet.CENTIGRAM); assertEquals(expResult, result); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['("""", \'\')', ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testGetServerKeyManagerPassword2() { System.out.println(""getServerKeyManagerPassword2""); String result = testObj3.getServerKeyManagerPassword(); assertNull(result); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##t\ |
|
is is an to |
|
the. the |
|
word.Sever.\\nn\ * |
|
. |
|
nn\\ * |
|
\\ |
|
. the Keyword.S... |
|
you Keynnn\\ *\\ *. used used. the thens\n |
|
nn\\ *\\return... |
|
. |
|
.nn\\ *\\ ""nn@ \\\\\ ""\\\s. |
|
n\\@\\\\'. |
|
|
|
the. |
|
\ sierp\\J *\\\.ting |
|
,.,.@ |
|
@. |
|
. |
|
.System"""","","","","", |
|
*Key = null.;. |
|
;Key... |
|
*,,String) |
|
\@\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testWithNullVolumeId() throws Exception { when(awsHelperService.getVolumeId(activePreviewPublishId, awsDeviceName)).thenReturn(null); boolean result = action.execute(instanceId); verify(aemHelperService, times(1)).pairPreviewPublishWithDispatcher(instanceId, unpairedDispatcherId); verify(replicationAgentManager, times(1)).createPreviewReplicationAgent(instanceId, PreviewPublishAemBaseUrl, authorAemBaseUrl, AgentRunMode.PREVIEWPUBLISH); verify(replicationAgentManager, times(1)).pausePreviewReplicationAgent(activePreviewPublishId, authorAemBaseUrl, AgentRunMode.PREVIEWPUBLISH); verify(aemHelperService, times(0)).tagInstanceWithSnapshotId(instanceId, snapshotId); verify(replicationAgentManager, times(1)).resumePreviewReplicationAgent(activePreviewPublishId, authorAemBaseUrl, AgentRunMode.PREVIEWPUBLISH); assertThat(result","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea ')'', line aorter of') the serverlisher')n',""] |
|
|
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
|
|
void testCreateout()()() throws Exception { |
|
|
|
(mockMock..getVolumeId(anyPubviewPublish)).)). nullHelper)).)).thenReturn(null); when result = aws.execute();awsId, assert(awserClientService). times(1)).createPreviewPublishWithTags(eqId, activepairedPreId, verify(alicationHelperService, times(1)).createRepviewPublicationAgent(eqId, unviewReplish.wsHelper.. un unizeremUserUrl, TypeAs.NVIEW_BLISH, verify(replicationAgentManager, times(1)).createausePreviewReplicationAgent(instancePreviewPublishId); PreAemBaseUrl, Agent AgentRunMode.PREVIEWPUBLISH); verify(repemHelperService, times(1)).pairPre(PreId(instanceId, snapshotId); verify(alicationAgentManager, times(1)).createumePreviewReplicationAgent(activePreviewPublishId, authorAemBaseUrl, AgentRunMode.PREVIEWPUBLISH); verifyEquals(result,"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void output() throws Exception { RecordDefinition<String[]> def = RecordDefinition.builder(String[].class) .withField(self(), field(0).build()) .build(); String[][] results = emit(def, new String[][] { { ""Hello, world!"", }, }); assertThat(results, is(new String[][] { { ""Hello, world!"", }, })); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow:: |
|
or |
|
: |
|
of a |
|
the: |
|
a |
|
to... |
|
|
|
BelBel# |
|
|
|
|
|
##Instm |
|
|
|
method |
|
. |
|
nn\\ * |
|
\\\\\\> |
|
|
|
. |
|
nn\\ * |
|
\\\\\\ |
|
data\\\\nn\\ *\\\\\\ data\\\\nn\\ * |
|
\\\\\\\\\\\\@s\\ |
|
the\\ |
|
\\ sierp\\@ *\\\\ |
|
@ as@ @, of@>>@n null<< |
|
,n,J |
|
,J [email protected], |
|
.self) |
|
ings@ .@ers |
|
.,@@. @String) ,));[]@ .@ """" ""} |
|
"" "" "" |
|
.,,b,newa1,)););@ .@Hello, world}}, "" "" "" |
|
"" ,"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', '')"", ""('', ' |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea's'\\\\t\\\\\\-emptyavadoc)\\n\\\\t * (\\n\\\\t * (param\\.apacheds.jvmon.core.J.J.FileType.ingData.ware.get\\n\\\\t * getCollectionPathPathDisplay(java.lang.String,\\n\\\\t *\\ '""] |
|
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n\\\\t * Received two double vectors and calculates the Chi distance.\\\\n\\\\t * @param v1 vector number 1.\\\\n\\\\t * @param v2 vector number 2.\\\\n\\\\t * @return The Chi distance.\\\\n\\\\t */', '')"", ""('', '//casting (double) a v1.length\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test // jdsalazar public void test03() { double[] v1 = new double[] {8,3,4}; double[] v2 = new double[] {6,5,10}; Asserts.assertEqualLength(v1, v2); Asserts.assertGreaterThanZero(v1); Asserts.assertGreaterThanZero(v2); double res = Chi.distance(v1, v2); Asserts.assertEquals(res, 0.5263882104539921); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\\\t\\\\ive a integers values and returnsates the dot- between\\\\n\\\\t * @param v1 the 1\\\\\\n\\\\t * @param v2 vector number 2.\\\\n\\\\t * @return Chi Chi distance.\\\\n\\\\t *' '""] |
|
public/** '/** Chi the the\\) to string1 to\\()\\\\"", |
|
|
|
### Inst CaseUnit: the: |
|
|
|
sierpTest |
|
publiccastUnit.v |
|
// void testCh1() { |
|
//[] v1 = { double[] { . ,1, double[] v2 = new double[] {1,2,7};}; doubleserts.assertEquals((v1, v2); Asserts.assertEqualaterThan((v1[ Asserts.assertGreaterThanZero(v2); As[] = ChiDistancedistance(v1, v2); As serts.assertGre(1, 1.0);63682733333655, } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('/**\\\\n * Generates a po file from a Resource and a TranslationsResource, using the\\\\n * publican directory layout.\\\\n *\\\\n * @param baseDir\\\\n * @param doc\\\\n * @param locale\\\\n * @param targetDoc\\\\n * @throws IOException\\\\n */', '')"", ""('', '// write the PO file to $locale/$name.po\\n')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void writeWithDefaultOptions() throws Exception { // given writer = new PoWriter2.Builder().create(); Resource srcDoc = createDoc(); TranslationsResource doc = createTranslations(); ByteArrayOutputStream out = new ByteArrayOutputStream(); // when writer.writePo(out, UTF_8, srcDoc, doc); // then String result = out.toString(UTF_8); assertThat(result).isEqualTo(contentOfResource(""writeWithDefaultOptions.po"")); }","OOOOOOOOOOOOOOOOO sierp##ru: |
|
ow, the acceptable ( tells how way of a. a. |
|
a method codeSPTest.. |
|
The |
|
# : |
|
|
|
\"",""/n\\\\ * |
|
a samenn * Gener static instruction from. |
|
\\n * Gener\\n *\\@ paramDir |
|
\\\\ *\\param baseDir\\\\ * @param dir\\\\\\ * @param langDir\\nn * @paramrows\\\\\\\\ * |
|
|
|
|
|
|
|
\\ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testVersion() { String version = Platform.getVersion().getVersionNumber(); Pattern pattern = Pattern.compile(""^(\\d+\\.\\d+\\.\\d+)(-.*)$""); Matcher matcher = pattern.matcher(version); assertTrue(matcher.matches(), ""Unexpected format for :"" + version); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow,: anor |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
|
|
\\\\nn\\ |
|
the |
|
of innn\\tn\\ |
|
nn\\\\n\\\\\\\\ |
|
\\\\nn\\tt\\ |
|
|
|
|
|
|
|
##### |
|
. |
|
|
|
the |
|
|
|
## sierp-> |
|
@ |
|
|
|
|
|
public |
|
|
|
publicpublic}@ String.public()() |
|
Version()() |
|
@@s, Pattern. |
|
.String""""n"","",ttt+"",ttt+"",.\\)@ |
|
\Pattern.,er, match, |
|
er,b) PatternPattern,),er,t)\\\"","""","") a \J "", Match \"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void hashCodeOfDifferentModificationDate() { |
|
the |
|
of a, a. |
|
a |
|
..... |
|
TheThe# #: The |
|
\J*nn\\ = |
|
|
|
|
|
|
|
\\# \s |
|
|
|
Java |
|
|
|
|
|
sierp@ |
|
public static |
|
|
|
|
|
|
|
|
|
|
|
es |
|
|
|
|
|
|
|
public |
|
( |
|
}}}} Object ObjectInfo2Object)))1)STT)_ID)) OPERX_ID) OB)_FORMLEULT,,ID, O OROWB,SIZE,, OUMB_SIZERES_D_SIZE, OUMB_FORME,SIZE, THUMB_PIX_SIZEIGHT, TH THTERSK_HEX_HE, IMAGE_PIX_HEIGHT, IMAGE_PI,WIDTHSCTH, IAGEENTHHEJECT_ P THGE__,_OB, ASSO_A_SIZESC, ACTIONENCE_TYPE, SE_NUMBER, FILE ILATIT_NUMBER, C |
|
"" ""_DS, |
|
publicInfo |
|
Info;; null ObjectInfo2STORAGE_ID, OBJECT_IDAT, PROTECTION_STATUS, OBJECT_FORMRESSED_SIZE, O THUMB_PIAT, THUMB_PIRESSED_SIZE, THUMB_PIX_HE, THUMB_PIX_HEIGHT |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['("" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void multipleWritersWithTags() { Configuration.set(""writer1"", ""console""); Configuration.set(""writer1.tag"", ""system""); Configuration.set(""writer2"", ""console""); Configuration.set(""writer2.tag"", ""technical""); Configuration.set(""writer3"", ""console""); Configuration.set(""writer3.tag"", ""system""); List<String> tags = ConfigurationParser.getTags(); assertThat(tags).containsExactlyInAnyOrder(""system"", ""technical""); }","OOOOOOOOOOOOOOOOOO sierp##ru: |
|
ow, the acceptable ( tells how way of a. a. |
|
a method codeSPTest.. |
|
The |
|
# : |
|
|
|
\test/n""\\\\n\\ |
|
n\\\\tt * Lo\\n\\\\t *\\param |
|
from\\\\\\\\t * |
|
"" |
|
|
|
|
|
|
|
# DescriptionsUnit test Java |
|
|
|
## sierpreturn |
|
@ void testTestritesInin() |
|
|
|
cgetWwrit"","", ""writer""); Configuration.set(""writer2"",tag1 ""console""); Configuration.set(""writer2"", ""console""); Configuration.set(""writer2.tag"", ""systemology""); Configuration.set(""writer3"", ""console""); Configuration.set(""writer3.tag"", ""techn""); Configuration<String> writers = new..getTags(); List tags(tags).containsAllactlyInAnyOrder(system""); ""technical""); |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\\\t\\\\ive a integers numbers of returnsates the dotward- between\\\\n\\\\t *\\param v1 The vector\\ 1\\\\\\n\\\\t * @param v2 binary vector number 2.\\\\n\\\\t * @return the Forbes distance.\\\\n\\\\t *' '""] |
|
|
|
### Solution CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
public@Unit |
|
v |
|
|
|
|
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test void testDocumentWithoutContent() throws RedPenException { List<Document> documents = new ArrayList<>(); documents.add(Document.builder() .setFileName(""tested file"") .build()); RedPen redPen = getRedPenWithSentenceValidator(); List<ValidationError> errors = redPen.validate(documents).get(documents.get(0)); |
|
: |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\\ = |
|
_ J text.. |
|
: the is.. a NULL.. |
|
ditill.. to be aushed. the other. |
|
nn\\ *\\nn\\ *\\cr{. text.. by theagraphann\\ *\\param\\ of the..nn\\ * |
|
|
|
|
|
|
|
|
|
|
|
# |
|
. |
|
|
|
the |
|
|
|
## sierp@J @ |
|
|
|
|
|
out |
|
. |
|
irectill |
|
s |
|
@<T>}. null List< |
|
List; |
|
itional |
|
)add,){ Listadd))"",."");"");} .setings |
|
.Paperough;ill |
|
new;Pet;outetsities@. |
|
.<!>> |
|
; newset; |
|
.Documents) |
|
;documents.get)document0 |
|
List. |
|
data; |
|
) |
|
|
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testReadWithInvisible() { EasyMockSupport support = new EasyMockSupport(); PreferencesImpl prefs = new PreferencesImpl(FeatureActionsRegistry.class.getName()); PreferencesRegistry prefsRegistry = createPrefsRegistry(support, prefs); support.replayAll(); FeatureActions actions = new FeatureActions(); actions.getActions().add(createAction1()); actions.getActions().add(createAction2()); FeatureAction invisible = createAction2(); invisible.setVisible(false); actions.getActions().add(invisible); prefs.putJAXBObject(ourLayerId, actions, false, this); FeatureActionsRegistry registry = new FeatureActionsRegistry(prefsRegistry); FeatureActionEditController controller = new FeatureActionEditController(registry, ourLayerId); assertEquals(ourGroupName, controller.getModel().getFeatureGroups().get(0).getGroupName()); assertEquals(2, controller.getModel().getFeatureGroups().get(0).getActions().size()); assertEquals(FXUtilities.fromAwtColor(","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisets the value of user is edit.\\\\n * @\\n * @return the model model model.\\\\n */"" '""] |
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
public void testGet()outcompleteChar throws { |
|
EditorObjectMock.. = new EasyMockSupport(); supportferences pre prefs = new PreferencesImpl();support...get);get(), preferencesImpl registryfsRegistry = newPrefsRegistry(p); prefs); pre.replayAll(); preatureActionsRegistry = new FeatureActions( actions.setP().put(newAction(()); actions.getActions().add(createAction2()); actionsatureActionsRegistryAction createIn3(); invisible.setIn(false); actions.getActions().add(invisible); Fefs.set(B((FeatureFeature,, actions); true); false. preatureActionsRegistry registry = new FeatureActionsRegistry(prefsRegistry); FeatureActionsRegistrying controller = new FeatureActionEditController(registry, ourLayerId); controllerEquals(actionsLayerId, controller.getGroup().getGroupActions().get(0).getNameGroupName()); assertEquals(our, controller.getModel().getFeatureActions().size(0).getActions().size()); assertEquals(1Action..getStringwt((Color"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * This a to the element in\\ be used for we want the\\\\n *' '""] |
|
(' |
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void test1802195() throws IOException, ClassNotFoundException { ValueMarker m1 = new ValueMarker(25.0); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(m1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); ValueMarker m2 = (ValueMarker) in.readObject(); in.close(); assertEquals(m1, m2); m2.setValue(-10.0); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ |
|
|
|
\\\\ = |
|
.. |
|
of the value. the the |
|
i}er} the, |
|
thenn\\ * |
|
\\\\ers. |
|
nn\\ * |
|
nn\\ *\\\\et\\1 value of |
|
nn\\ *\\nn\\ *\\\\\\\\\\@nn\\ *\\nn\\ *\\\\\\19 |
|
. |
|
.nn\\ *\\ * |
|
|
|
#####\\. |
|
|
|
the |
|
|
|
## sierp@J * |
|
|
|
...00.@@ a111,,n *J,,, m new111,,1, |
|
*.,,, Byte ByteArray{{ |
|
*[];; Object Object[{new) |
|
Object, |
|
.;buffer), |
|
Object.n( |
|
out[]. the new Object[](new Object ObjectArray)(new)new.Array) |
|
*J in10 newnew)2 in new |
|
;; |
|
Object. |
|
; Object false(new),m1, |
|
m2)2;)1))2, |
|
m |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testUnregisterOnJMException() throws JMException { final MBeanServer mockServer = createMock(MBeanServer.class); final Capture<ObjectName> captureName = new Capture<ObjectName>(); final Capture<ObjectName> captureName2 = new Capture<ObjectName>(); expect(mockServer.isRegistered(capture(captureName))).andReturn(true); mockServer.unregisterMBean(capture(captureName2)); expectLastCall().andThrow(new InstanceNotFoundException()); replay(mockServer); final JmxSupport support = new JmxSupport(mockServer); support.unregister(""subType"", ""foo""); verify(mockServer); final ObjectName name = captureName.getValue(); assertThat(name, notNullValue()); assertThat(name.getDomain(), is(JmxSupport.DOMAIN_NAME)); assertThat(name.getKeyProperty(""type""), is(""metrics"")); assertThat(name.getKeyProperty(""subType""), is(""subType"")); assertThat(name.getKeyProperty(""name""), is","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thiscomments a givenessen from the given nametypename. name.\\\\n * @\\n * @param subType the\\n * The sub- of the MBean.\\\\n * @param name\\\\n * The name of the MBean.\\\\n *"" '""] |
|
|
|
### Ex CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
|
|
void testUnregisterMSubMX() throws ExceptionMException { |
|
M MBeanServer mServer = mockMock(MBeanServer.class); final Objecture<MName> capture = = new Capture<ObjectName>(); final Capture<ObjectName> captureSub2 = new Capture<ObjectName>(); final(mockServer.getRegistered(captureNamecaptureName),).andReturn(false); expectServer.unregisterMBean(captureNamecaptureName2)); reLastCall().andThrow(new JanceNotFoundException("" replay(mockServer); try MMTest j = new JmxSupport(mockServer); support.unregisterOncomType"", ""name""); verify(mockServer); } MName name = captureName.getValue(); assertEquals(name. is(Value()); assertThat(name.getKey(), is(""nullMSupport.DEFAULTMAIN));NAME)); assertThat(name.getKey(),(),sub""), is(""subrics"")); assertThat(name.getKeyProperty(""subType""), is(""subType"")); assertThat(name.getKeyProperty(""name""), is("""
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'\', \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void toXmlLines_validRule_containsAllInformation() throws Exception { XmlRule rule = new XmlRule(""DEPENDENT"", ""DEPENDENCY"", Severity.FAIL); List<String> lines = rule.toXmlLines("""").collect(toList()); assertThat(lines).containsExactly( ""<xmlRule>"", ""<dependent>DEPENDENT</dependent>"", ""<dependency>DEPENDENCY</dependency>"", ""<severity>FAIL</severity>"", ""</xmlRule>""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Inst ##ow. a anor |
|
the |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##J'J |
|
|
|
'\\'n\\ |
|
ated a instruction.. an.. |
|
nn\\tn\\\\nn\\\\\\\\\\Creet.tn\\\\\\\\\\\\nn\\nn\\\\\\ where create\\ join\\ |
|
,t}\\nnnn\\\\ntt\\\\t\\\\\\\\\\\\\\\\\\param\\.. a.,,nn\\\\\\\\\\n \\\n |
|
|
|
|
|
\#\. |
|
|
|
the |
|
|
|
## sierp@J@ \ |
|
String |
|
1__1__, |
|
. |
|
@@ }} rule Java }newSC"")"")ITY ""DEPEND"")"")"")"") ""ity) |
|
ILS |
|
(E> _ ; |
|
.._DE |
|
() |
|
,< |
|
to ed theto) |
|
(actly.lineslines |
|
"">> """" <xml> PEND"");ERdependent> "" <"">DEPEND"");DF</<dependent> <dependentvere>> CTSsever>> <se>>DE "
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testTopoIterationOrderComplexGraph() { for (int seed = 0; seed < 20; seed++) { DirectedAcyclicGraph<Long, DefaultEdge> dag = new DirectedAcyclicGraph<>(DefaultEdge.class); RepeatableRandomGraphGenerator<Long, DefaultEdge> graphGen = new RepeatableRandomGraphGenerator<>(100, 500, seed); graphGen.generateGraph(dag, new LongVertexFactory(), null); ConnectivityInspector<Long, DefaultEdge> connectivityInspector = new ConnectivityInspector<>(dag); Iterator<Long> internalTopoIter = dag.iterator(); List<Long> previousVertices = new ArrayList<>(); while (internalTopoIter.hasNext()) { Long vertex = internalTopoIter.next(); for (Long previousVertex : previousVertices) { connectivityInspector.pathExists(vertex, previousVertex); } previousVertices.add(vertex); } } }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * This the string sort of for\\\\n * @\\nn * @return an topological order iterator.\\n *"" '""] |
|
|
|
### Solution CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
|
|
void testTopologicalOrder()()()x()() { { |
|
Top (int i = 0; seed < 10; seed++) GraphedGraphcyclicGraph<Integer, LongEdge< graph = new new DirectedAcyclicGraph<LongnewEdge.class); dagversableGraphizer<<Long, DefaultEdge> rGenerator = new RepeatableRandomGraphGenerator<>(dag00, 10,, , graphGen.add((dag); Default(Id< new); TopivityIteratorspector<Long, DefaultEdge> inspectivityInspector = new ConnectivityInspector<>(dag); connectator<Long> itIteratoroIter = .top(); Iter<Long> top =ices = new ArrayList<>(); while (internalTopoIter.hasNext()) { Long vertex = internalTopoIter.next(); if (Long neighborVertex : previousVertices) { ifivityInspector.check((vertex, previousVertex); }previous previousVertices.add(vertex); } } } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['("""", \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void shouldCreateGlobalConstraintWithNoMethodsOmittedForNonCor() { |
|
a second Java.... |
|
The |
|
# \:1 |
|
A_*""""""] * |
|
. ... the |
|
oreure |
|
nn |
|
* |
|
nn |
|
* BuildAn> |
|
|
|
ity of the from thep Therict;}H}ITY}1LE}RE}nnn |
|
*\\\n *\\p> |
|
ION:. be be a to thenn\\ *\\link RestConfig}AUTH_ROROLE}ROLOWERROIGINSAUT} |
|
a a if |
|
nn\\ *\\nn *\\A[ |
|
|
|
rest of.s.s |
|
nn\\ *\\param \ rest. from |
|
nn * |
|
""nn |
|
|
|
|
|
|
|
#\. |
|
|
|
the |
|
|
|
## sierp@ |
|
1 static |
|
Throw()()()(Args()itted()(Nullout |
|
|
|
public |
|
by |
|
|
|
Config;NoconfigmutableMap<Builder(Im ""Config.ofCESS_CONROL_ORLOW_ORIGIN_RE)); |
|
config |
|
} Given: |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testWithInputformatCalledTwiceThrows() { final String inputformat1 = ""inputformat1""; final String inputformat2 = ""inputformat2""; final PipesBuilder builder = new PipesBuilder(); builder.withInputformat(inputformat1); expectedException.expect(IllegalStateException.class); builder.withInputformat(inputformat2); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow:: |
|
or |
|
: |
|
of a that the |
|
|
|
a |
|
to... |
|
|
|
TheThe# |
|
: |
|
##\\ |
|
ed\\ |
|
|
|
. the.. |
|
nn\\ * |
|
\\et\\. |
|
.. the. the.. |
|
nn\\ *\\\\\\ is. |
|
nn\\ * |
|
\\\\ |
|
#####\\ing |
|
|
|
the\\ |
|
\\ sierp\\ |
|
* |
|
|
|
|
|
this |
|
.@ |
|
enty@ese@@\\ @}@}}. nullJ""1. |
|
@@@format1) ""input""1"" |
|
final testrep =,, ""Jes'; |
|
final; |
|
draws.input,,, |
|
final =s |
|
sinputlegal,,, |
|
, |
|
final. |
|
Inputs.input,,, |
|
* |
|
\\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""(' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void toString_shouldPrintEmptyLowIfLowIsNull() throws Exception { DoubleRange r = new DoubleRange(null, 1.0); assertEquals(""< 1.0"", r.toString()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow, a anor |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\\nn\\ |
|
nn\\\\n\\\\\\ |
|
method. of the |
|
.,tn\\tn\\\\returner |
|
\\ of the. low and the high. not null andnn\\tn\\\\should\\ the\\ and high and not\\nn\\tt\\\\should print the high\\ high high not\\nn\\tn\\@should print the high\\ high high not and not\\nn\\tn\\@ |
|
|
|
|
|
\\\\ ""\\',', ' print print the is high and not not\\n\\@ |
|
|
|
###'. |
|
## the. should## sierpshouldJ @ |
|
the |
|
n |
|
|
|
|
|
ow,Nullow,In, |
|
as |
|
should};, Double Double }{new,null201) |
|
Double false(""1.1. "")1) |
|
r |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test void ensureDeletionOfDepartmentHeadAssignmentOnPersonDeletionEvent() { final Person departmentHead = new Person(); departmentHead.setId(42L); final Person other = new Person(); other.setId(21L); final DepartmentEntity department = new DepartmentEntity(); department.setId(1L); department.setDepartmentHeads(List.of(departmentHead, other)); when(departmentRepository.findByDepartmentHeads(departmentHead)).thenReturn(List.of(department)); when(departmentRepository.findById(1L)).thenReturn(Optional.of(department)); when(departmentRepository.save(department)).thenReturn(department); sut.deleteDepartmentHead(new PersonDeletedEvent(departmentHead)); verify(departmentRepository).findByDepartmentHeads(departmentHead); ArgumentCaptor<DepartmentEntity> argument = ArgumentCaptor.forClass(DepartmentEntity.class); verify(departmentRepository).save(argument.capture()); assertThat(argument.","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisletes a the recordsingsments for a given department.\\\\n * @\\n * @param person the event to is the\\\\n *"" '""] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
public testDeleteletesOfPersonartmentHeadAssign()PersonDeletion()() { |
|
|
|
Person personHead = new Person("" departmentHead.setId(1););); department Person personPerson new Person(); other.setId(43L); final PersonHead department = new DepartmentEntity(); department.setId(1L); department.setNameartmentHead((newsof(departmentHead)); other)); department(departmentHead.findByIdDepartmentId((anypartmentHead)).thenReturn(de.of(department)); when(departmentHead.findBy(anyL)).thenReturn(Optional.of(department)); when(departmentRepository.delete(department)).thenReturn(department); whenut.deleteDepartmentHeadAssde PersonDeletEvent(departmentHead)); assert(departmentRepository,deleteByDepartmentHeads(departmentHead); verifyCaptor<DepartmentEntity> captCapt ArgumentCaptor.forClass(DepartmentEntity.class); verify(departmentRepository,save(argument.capture()); assertThat(argument.getValue"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testValueAsString() { final UuidElement element = new UuidElement(""f"", TEST_UUID); assertEquals(TEST_UUID.toString(), element.getValueAsString()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow, a anor |
|
: |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\\ = |
|
iheritres}nnn{ *\\\\> |
|
nn\\ *\\ the |
|
of the |
|
in}sed}\{\{\ |
|
nn\\ *\\p> |
|
nn\\ * |
|
|
|
|
|
|
|
\###\\.Unit |
|
the |
|
|
|
## sierp@J * |
|
|
|
|
|
|
|
public, |
|
|
|
public}}}}} U Uuid;}U"") ""STestUU) |
|
*(,TE)UU) |
|
) TE) |
|
))) |
|
U |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testWriteToPrintWriter() { final StringWriter sink = new StringWriter(); final PrintWriter writer = new PrintWriter(sink); final BasicConnectionMetrics metrics = new BasicConnectionMetrics(null); metrics.writeTo(writer); assertThat( sink.toString(), is(""Connection["" + System.identityHashCode(metrics) + "": sentBytes=0, sentCount=0, receivedBytes=0, receivedCount=0, "" + ""lastLatency=0 ms, totalLatency=0 ms]"")); |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thises a string- string of the given to to\\\\n * @\\n * @param metrics The\\n * The writer to write the.\\\\n *"" '""] |
|
public |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
",@Test public void filter_shouldFilterListOfFlags() { List<Flag> flags = Context.getService(FlagService.class).getAllFlags(); Tag tag = Context.getService(FlagService.class).getTag(1); Set<Tag> tags = new HashSet<>(); tags.add(tag); Filter filter = new Filter(tags); List<Flag> filterFlags = filter.filter(flags); assertTrue(flags.size() != filterFlags.size()); },"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Inst ##ow. a anor |
|
the |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\nn\\',j\\\\nn\\\\n\\ |
|
|
|
|
|
""\\\\ ""\\''); |
|
.n\\ the |
|
at. |
|
the of two. the |
|
. the first.\\\\ |
|
|
|
|
|
###'s |
|
|
|
the |
|
|
|
## sierp@J J |
|
|
|
|
|
test_ |
|
_ |
|
|
|
|
|
|
|
public ofList>}} List} |
|
()}1))get) |
|
Service)() |
|
List}} Tag.getAll;Flag))class)getAll{Flag, |
|
List<Flag> |
|
; Context SetSet; |
|
List;getitionalTag) |
|
Tags); Filter Filter;Filter) |
|
Filter<Flag> |
|
;; new;get.Flag) |
|
Listed)flag)get)){ true))filter( |
|
Filter |
|
{"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testmultiply1() throws UnitException { System.out.println(""multiply1""); QuantitativeAmount q = new QuantitativeAmount(BigDecimal.TEN, MassUnitSet.GRAM); QuantitativeAmount expResult = new QuantitativeAmount( new BigDecimal(100), MassUnitSet.GRAM); QuantitativeAmount result = Quantities.multiply(q, BigDecimal.TEN); assertEquals(expResult, result); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisify birğ\\n3\\xaxb3n\\xc3\\\\x91\\\\\\ı\\xc3\\\\x84\\\\xc5\\\\x94\\ dedemasak z\\\xc3\\\\xb4\\\\xc2\\\\xb7\\ y\\\xc3\\\\x84\\\\xc2\\\\x0\\\ma\\xc\\ * \\\\xc * @param de The\\n * @return target\\\\n * @return\\\\\n *"" '""] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
|
|
void test()ly()() { ExceptionTest { |
|
|
|
.out.println(""multiply1""); SystemityTest amounta new QuantitativeAmount(1Decimal.valueOfEN, ""Unit..GRAM); QuantitativeAmount q = = new QuantitativeAmount(Big BigDecimal(10),), MassUnitSet.GRAM); QuantitativeAmount result = qitative.multiply(q, qDecimal.ONEEN); assertEquals(expResult, result); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void deletedEntriesAreNotMigrated() { fromKvs.createTables(TEST_AND_CHECKPOINT_TABLES); fromTxManager.runTaskWithRetry(tx -> { tx.put(TEST_TABLE, ImmutableMap.of(TEST_CELL, TEST_VALUE1)); return tx.getTimestamp(); }); fromTxManager.runTaskWithRetry(tx -> { tx.delete(TEST_TABLE, ImmutableSet.of(TEST_CELL)); return tx.getTimestamp(); }); KeyValueServiceMigrator migrator = KeyValueServiceMigrators.setupMigrator(migratorSpec); migrator.setup(); migrator.migrate(); assertThat(toKvs.get(TEST_TABLE, ImmutableMap.of(TEST_CELL, Long.MAX_VALUE))) .isEmpty(); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea ')'',',',""] "" |
|
|
|
### Inst CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
|
|
void test_ries()NotInovedated() { |
|
|
|
.is(); } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
",@Test public void isNullViewMappedReturnsFalse() throws Exception { assertFalse(config.isViewMapped(null)); },"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Inst ##ow, a anor |
|
the |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\ = |
|
uss the you |
|
.s, an by the otheri |
|
sed} the |
|
. the |
|
. of |
|
nn\\ * |
|
\\> |
|
nn\\ *\\\\>\\ that |
|
n> |
|
is be be the the./}} |
|
}<. a by |
|
nn\\ *\\\\nn\\ *\\A if. a given. is a by is, the false |
|
nn\\ * |
|
* |
|
|
|
|
|
|
|
#\.Unit |
|
the. |
|
## sierp@J * |
|
a |
|
|
|
ed ifs.; |
|
. * |
|
public false}a) |
|
.)ed)config, |
|
@ |
|
\"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
### 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.","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisates a random numberounite graph with\\\\n *\\\\nn * @param nSize number number.\\n * @param numCount the vertex factory\\\\n * @param edge the the used\\ this method\\ but be null\\\\n *"" '""] |
|
public |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void classpath_mapping_feedback_null() { RuntimeException e = assertThrows(RuntimeException.class, () -> BshClassPath.addMappingFeedback(null)); assertThat(e.getMessage(), containsString(""Unimplemented: already a listener"")); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow:: |
|
or |
|
: |
|
of a that the: |
|
a |
|
to... |
|
|
|
TheThe# |
|
: |
|
##\\ |
|
itional method the.., |
|
you... method.nn\\ * |
|
\\ a. |
|
nn\\ * |
|
\\\\.\\\\ the... |
|
nn\\ * |
|
|
|
\\ |
|
##### |
|
. |
|
|
|
the\\ |
|
\\ sierpJ |
|
* |
|
|
|
, |
|
n_mback_f_@ |
|
@ s. null(ese;aes |
|
,n@ null J.adows.s |
|
itional.back.R, |
|
*@,null,n, |
|
.)Jitspros"","",,,) |
|
* |
|
n"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['(\'\', \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testConstructedUriIsEscaped() { |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Test' +\*n\\ *\\ets the string for with the valuesafka settings..\\\\n *\\\\n * @ info, this builder fields are used:\\n *\\ul>\\\\n * < <li>\\ Kookeeper URIorum is session port are set from the Kadoop configurationi>zo</tt>li>\\\\n * <li>The Kiji URI name is taken to thett>kiji.DEFAULT_INSTANCE_NAME</tt></\\\\n * (whichtt>k""</tt>).\\li>\\\\n * <li>The K name is namespace name are set set emptyset.</li>\\\\n * ul>\\\\n * <\\n * <return a < configured with default defaultiji URI.\\\\n *','] '''] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
|
|
void testGetstructURIK()Validvenaped() { |
|
|
|
TODOniEMA_101 namesifier is be escaped-encoded. theandra |
|
ijiURI |
|
java |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test(expected = IllegalArgumentException.class) public void test_resolve_signing_key_throws_error_on_invalid_key_id() { JwsHeader jwsHeader = new DefaultJwsHeader(); jwsHeader.setAlgorithm(""HS512""); jwsHeader.setKeyId(""key id 666""); Claims claims = new DefaultClaims(); cerberusSigningKeyResolver.resolveSigningKey(jwsHeader, claims); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow,: |
|
or |
|
: |
|
of a that the, |
|
a |
|
to.... |
|
TheThe# |
|
: |
|
##\\ ' |
|
'asons |
|
-. |
|
... |
|
'\\ |
|
|
|
##### |
|
|
|
|
|
|
|
the |
|
|
|
## sierpJ |
|
J) nulllegal,)) |
|
,J2Test inJtest_testature intest_testese_key_th_test,th_nr@ |
|
Test.,.,,. nullJ.,,. |
|
Jw,, |
|
terorithm,J"","","","", |
|
Jw,.jter),J_"",1..7 |
|
juse. ClaJJlaims, |
|
J,;,s,,.s,s.,J,,,j) |
|
1 |
|
J"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
['("""", \'\')'] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testGoodAuths() { List<ZKAuthInfo> result = ZKUtil.parseAuth( ""scheme:data,\n scheme2:user:pass""); assertEquals(2, result.size()); ZKAuthInfo auth0 = result.get(0); assertEquals(""scheme"", auth0.getScheme()); assertEquals(""data"", new String(auth0.getAuth())); ZKAuthInfo auth1 = result.get(1); assertEquals(""scheme2"", auth1.getScheme()); assertEquals(""user:pass"", new String(auth1.getAuth())); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
TestHello""*"""" * This a string-separated list of strings tokensisms.\\ mechanism\\n * mechanism mechanism is be a the form:\\meeme\\me- where where scheme as\\n * format as by the ''auth\'\' method. the \oo API.\\\\n *\\'nn * @param auths The string-separated list stringisms\\\\n * @return a list of authentication authenticationations.\\n * @throws Zlink InvalidArgumentExceptionException} if the authString is\\\\\\n *"" |
|
'n'] |
|
|
|
### Ex CaseUnit: the: |
|
|
|
sierpTest |
|
|
|
void testParseAuth()() throws |
|
|
|
<StringKAuth>> auth = ZKAuth.parseAuthsauth ""\""eme:auth"");""sch scheme::data,pass""); assertEquals(2, result.size()); assertKAuthInfo auth1 = result.get(0); assertEquals(""scheme"", auth0.getScheme()); assertEquals(""data"", auth String(auth0.getData())); ZKAuthInfo auth1 = result.get(1); assertEquals(""scheme2"", auth1.getScheme()); assertEquals(""user:pass"", new String(auth1.getAuth()));} } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""(' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testUnorderedPairEquals() { Pair<String, Custom> p1 = UnorderedPair.of(CUSTOM, new Custom(1)); Pair<String, Custom> p2 = UnorderedPair.of(ANOTHER, new Custom(1)); Pair<String, Custom> p3 = UnorderedPair.of(ANOTHER, new Custom(2)); Pair<String, Custom> p4 = UnorderedPair.of(CUSTOM, new Custom(1)); Pair<String, Custom> p5 = UnorderedPair.of(CUSTOM, new Custom(2)); Pair<Custom, String> p6 = UnorderedPair.of(new Custom(1), CUSTOM); assertNotEquals(p1, p2); assertNotEquals(p1, p3); assertEquals(p1, p4); assertNotEquals(p1, p5); assertEquals(p1, p6); assertNotEquals(p2, p3); assertNotEquals(p2, p4); assertNotEquals(p2, p5);","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp ru of Theow. a Americanal |
|
the |
|
of a, a. |
|
a first..... |
|
TheThe# #: The |
|
\J*nn\\ = |
|
|
|
(. the the same of be a to; the |
|
*n\\ * Cre of by |
|
nn\\ * |
|
nn\\ * elementsA1...nn\\ *\\param a. \\.nn\\ * @param b@>\\ |
|
element\\ ofnn\\ * @param bA> |
|
first element\\\\nn\\ * @param the first ofnn\\ * |
|
|
|
|
|
|
|
|
|
\# *s |
|
|
|
the |
|
|
|
## sierp@ |
|
@ static |
|
|
|
its |
|
|
|
|
|
|
|
public |
|
publicair}E>...>}1} PorderedPair}pIntint))) C C)C) |
|
Pair<String, new>p1} PorderedPair.of(CYHER, new Custom)1)) |
|
Pair<String, Custom> p3 = UnorderedPair.of(ANOTHER, new Custom(1)); |
|
Pair<String, Custom> p4 = UnorderedPair.of(ANUSTOM, new Custom(3)); Pair<String, Custom> p5 = UnorderedPair.of(CUSTOM, new Custom(2)); Pair<String> Custom, p6 = UnorderedPair.of(C Custom(3)); newUSTOM, P falseNull(C1) p2, |
|
PNotEquals(p3, p2); PNot(p4, p2); PNotEquals(p1, p2); PNot(p1, p3); PNotEquals(p1, p4); PEqualsEquals(p1, p4); PEqualsEquals(p1, p5); "
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""(' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testSerialization() throws IOException, ClassNotFoundException { VectorSeries s1 = new VectorSeries(""s1""); s1.add(1.0, 0.5, 1.5, 2.0); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(s1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); VectorSeries s2 = (VectorSeries) in.readObject(); in.close(); assertEquals(s1, s2); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp ru of Theow. the American in |
|
the lot of a, a. |
|
a first..... |
|
TheThe# \: Note |
|
\_*nn""] = |
|
the list |
|
|
|
nn\\ * Addnn\\ * AddAuthor1.1 corresponding |
|
axis x |
|
nn\\ * Addparam x |
|
* x-value. |
|
nn\\ * Addparam x |
|
|
|
* y.- |
|
nn\\ * @param xX |
|
the y x.\\nn\\ * |
|
|
|
|
|
|
|
|
|
|
|
# *s |
|
|
|
the |
|
|
|
## sierp@ |
|
* static |
|
|
|
izable() |
|
|
|
|
|
ThNotFoundException |
|
|
|
throws v}}} Vector VectorSeries sx1"") |
|
Vector2}s(s,1,11.1, 0.1, 1.5, |
|
s[] s s} Byte ByteArrayOutputStream(); |
|
s[][]; new ObjectOutputStream();Object) |
|
Object;out((buffer1); |
|
out.write(); |
|
outOutputStream out Java new ObjectInput(buffer ); ObjectArrayInputStream( ));byteArrayArray())); |
|
Object v s1 = newnewSeries s s;add(( |
|
Object.close(); |
|
Object false(Object1); s2, } |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')""] |
|
|
|
### Test JUnit in Java: |
|
","@Test public void simple() { JCommanderWrapper<Supplier<String>> commander = new JCommanderWrapper<>(""PG"", new Cmd(""R"")); Optional<String> result = commander.parse().map(Supplier::get); assertThat(result, is(Optional.of(""R""))); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram, Theow. a anor |
|
the |
|
of a that a, |
|
a |
|
..... |
|
TheThe# #: TheThe\J*nn\\ = |
|
nn\\ * \Authoret. |
|
..nn\\ * @param the program.. the then}} |
|
|
|
is a.. the thea) |
|
.g.nn\\ * @returnese the.. there. the equal.nn\\ * |
|
|
|
|
|
|
|
|
|
|
|
# *.Unit |
|
the |
|
|
|
## sierp@ |
|
@ static |
|
|
|
|
|
|
|
@Unitander.}@ress>R>}} null StringCommander<<JJ. "" J))"")"") |
|
J<R> |
|
; null} |
|
} |
|
.Jlier<<) |
|
J sub;String,resultaresult)get)R"")) |
|
|
|
J |
|
{"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void checkDocumentWithXSIDocTypeBoundGrammar() throws Exception { MockXMLLanguageServer languageServer = new MockXMLLanguageServer(); String xml = ""<foo xmlns:xsi=\""http: |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea ')'', if the given is a titleing.',n',""] |
|
|
|
### Inst CaseUnit: Eclipse: |
|
|
|
sierpTest |
|
public void testIfHasBoundPathLT()G()Grammar() throws Exception { |
|
DocumentitoDocument xml serverServer = new MockXMLLanguageServer(); language document = ""!><=\""xsi=\""http: |
|
"
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testAvroSchemaListContains() throws IOException { final KijiSchemaTable schemaTable = getKiji().getSchemaTable(); final long stringUID = schemaTable.getOrCreateSchemaId(STRING_SCHEMA); final long intUID = schemaTable.getOrCreateSchemaId(INT_SCHEMA); final String stringJSON = STRING_SCHEMA.toString(); final String intJSON = INT_SCHEMA.toString(); final AvroSchema stringUIDAS = AvroSchema.newBuilder().setUid(stringUID).build(); final AvroSchema stringJSONAS = AvroSchema.newBuilder().setJson(stringJSON).build(); final AvroSchema intUIDAS = AvroSchema.newBuilder().setUid(intUID).build(); final AvroSchema intJSONAS = AvroSchema.newBuilder().setJson(intJSON).build(); final List<AvroSchema> stringList = Lists.newArrayList(stringJSONAS, stringUIDAS); final List<AvroSchema> intList = Lists.newArrayList(intJSONAS, intUIDAS); final List<","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * s the given contains objectsat objects is is a schema schemaroSchema.. orving nested\\n * theRs to the given UryContextRegistry.\\\\n * \\\n * @param schemaCollection TheijiSchemaTable to which to resolve U UIDs\\\\\\n * @param schemaCollection Collection of AvroSchemaemas to check. a given of the given schema\\n * Av schema.\\\\n * @param elementToroSchema to which presence to check. theCollection.\\\\n * @return true theCollection contains the. resolving UIDs. schemaTable.\\\\n * @throws K if case of an error while the the Av collection.\\\\n *\\ |
|
""] |
|
public |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void configureDefault() throws SAXException, IOException { final ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class); EasyMock.expect(servletContext.getInitParameter(PrettyFilter.CONFIG_FILES_ATTR)).andReturn(null).anyTimes(); EasyMock.expect(servletContext.getResourceAsStream(PrettyConfigurator.DEFAULT_PRETTY_FACES_CONFIG)).andReturn( null).anyTimes(); final ClassLoader resourceLoader = new URLClassLoader(new URL[0], Thread.currentThread() .getContextClassLoader()) { @Override public Enumeration<URL> getResources(final String name) throws IOException { if (PrettyConfigurator.PRETTY_CONFIG_RESOURCE.equals(name)) { return enumeration(mockPrettyConfigURL()); } else { return super.getResources(name); } } }; final PrettyConfigurator configurator = new PrettyConfigurator(servletContext) { @Override protected ClassLoader getResourceLoader","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * Thisads a fileferencesPraces library from returns the |
|
.\\n * object.\\\\n *\\\\nn * @return theads configuration object\\\\n * \throws Exception If\\n * @ If the file not be loaded.\\\\n * @throws PreAXException\\\\n * If the fileion could not be parsed.\\\\n *\\ '""] |
|
public |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void earliest_shouldGetAnEmptyResultGivenAnEmptyResult() throws Exception { Result parentResult = new EmptyResult(); Assert.assertEquals(new EmptyResult(), parentResult.earliest()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Inst ##ow. a anor |
|
the |
|
of a that the, |
|
a |
|
..... |
|
TheThe# is: |
|
##\\ |
|
|
|
\\\nn\\',is |
|
|
|
ologicalically.\\) the)) |
|
..\\\\\\\\n\\\\return be the first result\\...\\\\\\\\n\\\\should get the first of\\ method.\\nn\\\\n\\@should get the instruction the\\\\ empty result\\nn\\\\n\\@should get get the first of the\\\\\\ a..nn\\\\n\\@should get the of\\ the\\\\\\ result results\\nn\\tn\\@ ' |
|
'\\\\ ""\\''); first the of get first result,\\\\ |
|
""\\\\ '\\\\ the of results isates\\ the.n\\ |
|
|
|
|
|
|
|
# |
|
. |
|
|
|
case. |
|
## sierpshould |
|
@ |
|
|
|
|
|
@ get theother |
|
(iven |
|
otherResultG |
|
.. |
|
@ }} Result ResultptyResult} |
|
@Resultion |
|
ed(Object ObjectptyResult) newResult) |
|
ly, @ "
|
|
"### Instruction: |
|
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
|
### Description: |
|
[""('', '')"", ""('', ' |
|
|
|
### Test JUnit in Java: |
|
","@Test public void testMzDB() throws MSDKException, IOException { File fileName = new File(TEST_DATA_PATH + ""OVEMB150205_12.raw.0.9.8_truncated.mzDB""); FileType fileType = FileTypeDetectionAlgorithm.detectDataFileType(fileName); Assert.assertEquals(FileType.MZDB, fileType); }","nobody################ru |
|
|
|
Hinweisow is a example on will how method of process. a. |
|
a method codeav test case. |
|
|
|
### Inst: |
|
|
|
Thea'*\\\\ * p>Thisnn * ThissType.(java\\n * <p>\\\\n * <\\n * <param fileName\\ filelink java.lang.File} object.\\\\n * @return the {@link java.github.mx.dataatodel.DataType} object.\\\\n * @throws java.io.IOException if the.\\\\n *"" '""] ""public |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|