\\\\n * < method modifies the {@ {@link StringOption}.\\\\n *
@
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:
[""('/**\\\\n * {@inheritDoc}\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void hashCodeOfDifferentModificationDate() { // 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, ""foo"", KEYWORDS); ObjectInfo objectInfo2 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX_HE","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram, Theow. a anal
the
of a, a.
a
.....
TheThe# #: The
\J*nn\\ =//linkjance}nnn{ *
\\# \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:
['(""/**\\\\n\\\\t * Generate the packing instruction suitable for adding the given user to iRODS.\\\\n\\\\t * \\\\n\\\\t * Note that the user DN is not updated in this call, as there appears to be bug\\\\n\\\\t * where it gets truncated. The {@code UserAO} methods will instead add a call\\\\n\\\\t * to the equivalent of \'iadmin aua\' to insert the user DN. See comments for\\\\n\\\\t * that class.\\\\n\\\\t *\\\\n\\\\t * @param user\\\\n\\\\t * {@link org.irods.jargon.core.pub.domain.User} to be added to\\\\n\\\\t * iRODS.\\\\n\\\\t * @return {@link GeneralAdminInp}\\\\n\\\\t * @throws JargonException\\\\n\\","@Test public void testAddUserCheckAPIType() throws Exception { User user = new User(); user.setName(""test""); user.setUserDN(""dn""); user.setUserType(UserTypeEnum.RODS_USER); GeneralAdminInp pi = GeneralAdminInp.instanceForAddUser(user); Assert.assertEquals(""incorrect api type"", GeneralAdminInp.GEN_ADMIN_INP_API_NBR, pi.getApiNumber()); }","nobody################ru
Hinweisow is a example on will how method of process. a.
a method codeav test case.
### Inst:
TestHello""*""""\\t\\\\ate a followinging list for for a to
- theTDS.\\\\n\\\\t *\\p>\\\\t\\\\t * @: the user mustN is not included in the method. so it is to be no in\\n\\\\t * in the is updatedated.\\ userlink user}ud} class will update update the new to\\n\\\\t * to the {@ of this\\addRO addp add to update the user.N.\\ the in more\\n\\\\t * more method for\\\\n\\\\t * <\\n\\\\t * 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\\//ading of the. the. the.
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 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:
[""('/**\\\\n\\\\t * Received two binary vectors and calculates the Forbes distance.\\\\n\\\\t * @param v1 binary vector number 1.\\\\n\\\\t * @param v2 binary vector number 2.\\\\n\\\\t * @return The Forbes distance.\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test //jdsalazar public void test3(){ int[] v1 = new int[]{1,0,1,1,0}; int[] v2 = new int[]{1,1,0,1,1}; Asserts.assertEqualLength(v1, v2); double res = Forbes.distance(v1, v2); Asserts.assertEquals(res, 0.166666666); }","nobody################ru
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
// void testFor()
////[] v1 = { int[]{1,2,1,0,1, int[] v2 = new int[]{1,1,0,1,1}; intymts.assertEquals((v1, v2); As distance = Forbes.distance(v1, v2); Asserts.assertEqual(0, 0.0266666666 }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * validate the input document collection. Note that this method call is NOT thread safe. RedPen instances need to be crated for each thread.\\\\n *\\\\n * @param documents input document collection generated by Parser\\\\n * @return list of validation errors\\\\n */', '')""]
### Test JUnit in Java:
","@Test void testDocumentWithoutContent() throws RedPenException { List documents = new ArrayList<>(); documents.add(Document.builder() .setFileName(""tested file"") .build()); RedPen redPen = getRedPenWithSentenceValidator(); List errors = redPen.validate(documents).get(documents.get(0)); // validate the errors assertEquals(0, errors.size()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow, a anor
:
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
@}. null List<
List;
itional
)add,){ Listadd))"",."");"");} .setings
.Paperough;ill
new;Pet;outetsities@.
.>
; newset;
.Documents)
;documents.get)document0
List.
data; //,(document)0)
)
//
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Gets the model the editor should edit.\\\\n *\\\\n * @return The editors model.\\\\n */', '')""]
### 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:
[""('/**\\\\n * Give id to each expression. Will be useful if we serialize.\\\\n */', '')"", ""('', '//ensure class analyzer. We need to know observables at this point\\n')"", ""('', '// observables gets initial ids\\n')"", ""('', '// non-observable identifiers gets next ids\\n')"", ""('', '// descendants of observables gets following ids\\n')"", ""('', '// already has some id, means observable\\n')"", ""('', '// only fields earn an id\\n')"", ""('', '// now all 2-way bound view fields\\n')"", ""('', '// non-dynamic binding expressions receive some ids so that they can be invalidated\\n')"", '(\'\', ""// we don\'t assign ids to constant binding expressions because now invalidateAll has its own\\n"")', ""('', '// flag.\\n')"", ""('', '// make sure all","@Test public void testStaticMethodOfInstance() { MockLayoutBinder lb = new MockLayoutBinder(); mExprModel = lb.getModel(); lb.addVariable(""user"", User.class.getCanonicalName(), null); MethodCallExpr methodCall = parse(lb, ""user.ourStaticMethod()"", MethodCallExpr.class); assertTrue(methodCall.isDynamic()); mExprModel.seal(); final Expr child = methodCall.getTarget(); assertTrue(child instanceof StaticIdentifierExpr); StaticIdentifierExpr id = (StaticIdentifierExpr) child; assertEquals(id.getResolvedType().getCanonicalName(), User.class.getCanonicalName()); }","nobody################ru
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 *' '""]
('/** '\\') that iszer is\\ need to ensure theables. compile point.\\',"", ""('', '//ensureables\\ theised\\n')"", ""('', '// we-observable getsifiers\\ ids id\\n')"", ""('', '// nonants of observableables gets ids ids\\n')"", ""('', '// descend assigned id id\\ so it\\n')"", ""('', '// already observable ofn ids id\\n')"", ""('', '// only we fields30level observ fields- earn')"", ""('', '// now-view fields\\\\ ids id\\ we we\\ be\\ated\\n')"", ""(""""', ""// non need't need ids to expressions expressions expressions\\ they weation them() to own idn"")'] ""('', '// now to\\n')"", ""('', '// now sure that expressions sierpId methods @ void testInvalidIn()Class() {\\ //ito mockinder b = new MockLayoutBinder(); lb... lb.bindModel(); m.setModel(x"", "".class);getNameCanonicalName()); ""); lb m m mCallExpr newMethodnew, ""user.getMethodMethod()""); nullCallExpr.class); assertEquals(methodCall.getStaticBinding assertExprModel.inal(); assert ListprModel = methodCall.getChild(); assertTrue(child instanceof MethodaticMethodExpr); assertaticIdentifierExpr static = (StaticIdentifierExpr) child; assertEquals(User.getIdvedType(),getCanonicalName(), "".class.getCanonicalName()); }"","
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Sets the value for the marker and sends a {@link MarkerChangeEvent} to\\\\n * all registered listeners.\\\\n *\\\\n * @param value the value.\\\\n *\\\\n * @see #getValue()\\\\n *\\\\n * @since 1.0.3\\\\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:
[""('/**\\\\n * Unregisters the MBean with the specified sub-type and name.\\\\n *\\\\n * @param subType\\\\n * The sub type for the MBean.\\\\n * @param name\\\\n * The name of the MBean.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testUnregisterOnJMException() throws JMException { final MBeanServer mockServer = createMock(MBeanServer.class); final Capture captureName = new Capture(); final Capture captureName2 = new Capture(); 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 capture = = new Capture(); final Capture captureSub2 = new Capture(); 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:
['(\'/**\\\\n\\\\t * Creates an XML string representing this rule.\\\\n\\\\t *\\\\n\\\\t * @param indent\\\\n\\\\t * \\\\t\\\\tthe string used to indent inner XML, possible {@code ""\\\\\\\\t""}\\\\n\\\\t *\\\\n\\\\t * @return this rule as an XML string\\\\n\\\\t */\', \'\')']
### Test JUnit in Java:
","@Test public void toXmlLines_validRule_containsAllInformation() throws Exception { XmlRule rule = new XmlRule(""DEPENDENT"", ""DEPENDENCY"", Severity.FAIL); List lines = rule.toXmlLines("""").collect(toList()); assertThat(lines).containsExactly( """", ""DEPENDENT"", ""DEPENDENCY"", ""FAIL"", """"); }","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
"">> """" PEND"");ERdependent> "" <"">DEPEND"");DF > CTSsever>> >DE "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Returns a topological order iterator.\\\\n * \\\\n * @return a topological order iterator\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testTopoIterationOrderComplexGraph() { for (int seed = 0; seed < 20; seed++) { DirectedAcyclicGraph dag = new DirectedAcyclicGraph<>(DefaultEdge.class); RepeatableRandomGraphGenerator graphGen = new RepeatableRandomGraphGenerator<>(100, 500, seed); graphGen.generateGraph(dag, new LongVertexFactory(), null); ConnectivityInspector connectivityInspector = new ConnectivityInspector<>(dag); Iterator internalTopoIter = dag.iterator(); List 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 rGenerator = new RepeatableRandomGraphGenerator<>(dag00, 10,, , graphGen.add((dag); Default(Id< new); TopivityIteratorspector inspectivityInspector = new ConnectivityInspector<>(dag); connectator itIteratoroIter = .top(); Iter 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:
['(""/**\\\\n * Build the standard global auth constraint from standard RestConfig.\\\\n *\\\\n * The valid roles is extracted from {@link RestConfig#AUTHENTICATION_ROLES_CONFIG}\\\\n *\\\\n *
OPTIONS requests will not require auth if\\\\n * {@link RestConfig#ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG} is not empty.\\\\n *\\\\n * @param restConfig the rest app\'s config.\\\\n * @return the constraint mapping.\\\\n */"", \'\')']
### Test JUnit in Java:
","@Test public void shouldCreateGlobalConstraintWithNoMethodsOmittedForNonCor() { // Given: config = restConfigWith(ImmutableMap.of( RestConfig.ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG, """")); // When: final ConstraintMapping mapping = AuthUtil.createGlobalAuthConstraint(config); // Then: assertThat(mapping.getMethodOmissions(), is(nullValue())); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp ru of Aow. the in in is the lot of a. a.
a second Java....
The
# \:1
A_*""""""] *// the
. ... 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 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 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:
[""('/**\\\\n * {@inheritDoc}\\\\n * \\\\n * Returns the result of the {@link UUID#toString()}.\\\\n *
\\\\n */', '')""]
### 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:
[""('/**\\\\n * Writes a human readable form of the collection metrics.\\\\n *\\\\n * @param writer\\\\n * The writer to write to.\\\\n */', '')"", ""('', '// Use the identity hash code as a stable identifier.\\n')""]
### 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]"")); // For Closeable. metrics.close(); }","nobody################ru
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/** '\\', this following function code for the hash hash for',\\',"",
### Ex CaseUnit: the:
sierpTest
public void test_To()Writer() throws
Print Print[] writer = new StringWriter(); final PrintWriter writer = new PrintWriter(sink); sink CollectionMetMetrics metrics = new BasicConnectionMetrics();1, metrics.writeTo(writer); assertEquals(s sink.toString(), contains(Use metrics + + "".identityHashCode(metrics) + "" ""=""=""0, receivedMessages=0, receivedBytes=0, receivedCount=0, "" + ""receErroratency=0,, lastLatency=0 ms,"")); } }@ theable,close sink.close(); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Constructors\\\\n\\\\t */', '')"", ""('', '// default the Filter\\tto match all Flags that contain one or more of the tags in the filter\\n')""]
### Test JUnit in Java:
",@Test public void filter_shouldFilterListOfFlags() { List flags = Context.getService(FlagService.class).getAllFlags(); Tag tag = Context.getService(FlagService.class).getTag(1); Set tags = new HashSet<>(); tags.add(tag); Filter filter = new Filter(tags); List 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
; Context SetSet;
List;getitionalTag)
Tags); Filter Filter;Filter)
Filter
;; 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:
[""('/**\\\\n * Verilen de\\\\xc3\\\\x84\\\\xc5\\\\xb8eri ayn\\\\xc3\\\\x84\\\\xc2\\\\xb1 birim olmak \\\\xc3\\\\x83\\\\xc2\\\\xbczere \\\\xc3\\\\x83\\\\xc2\\\\xa7arpar\\\\n * \\\\n * @param base\\\\n * @param amount\\\\n * @return \\\\n */', '')""]
### 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:
[""('', '//\\n')"", ""('', '//\\n')""]
### 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 ')'',',',""] ""//', '//\\n')"",
### Inst CaseUnit: Eclipse:
sierpTest
void test_ries()NotInovedated() {
//.afka.put(""();true_TABLEROREECK_OINT_TABLES); fromKxn.start((outry(newManager { tx.delete(""TEST_AND_ ""mutableMap.of(""TEST_KEYLL, ""ST_VALUE));)); tx null.commit((); }); fromKxManager.runTaskWithRetry(tx -> { tx.put(TEST_TABLE, TEmutableMap.of(TEST_CELL)); return tx.getTimestamp(); }); fromValueService fromigrator migrator = newValueServiceMigrrators.create(igrator(fromatorConfig -> migrator.migr( migrator.migrate(); fromEquals(fromKvs.get(TEST_TABLE, TEmutableSet.of(TEST_CELL, TE.class_VALUE))
.is(); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Discover if the given ViewId is mapped by any {@link UrlMapping} specified in the current configuration.\\\\n * \\\\n * Note:This will not match if a #{dynamicView.id} method is configured.\\\\n * \\\\n * @return True if the ViewId is mapped, false if not.\\\\n */', '')""]
### 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:
[""('/**\\\\n * Generates a random bipartite graph.\\\\n * \\\\n * @param target the target graph\\\\n * @param vertexFactory the vertex factory\\\\n * @param resultMap not used by this generator, can be null\\\\n */', '')"", ""('', '// create vertices\\n')"", ""('', '// check if graph is directed\\n')"", ""('', '// create edges\\n')"", ""('', '// s->t\\n')"", ""('', '// t->s\\n')""]
### Test JUnit in Java:
","@Test public void testDirectedGraphGnp1() { GraphGenerator gen = new GnpRandomBipartiteGraphGenerator<>(4, 4, 0.5, SEED); Graph 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/** '/** Gener a',\\',"", ""('', '// create if the is b\\n')"", ""('', '// check edges\\n')"", ""('', '// checkiftv\\n')"", ""('', '// check->s\\n')"",
### Ex CaseUnit: the:
sierpTest
void test()ed()()()()() { { }Generator gInteger, IntegerVertex< Default> g = new new Directnp1GraphipartiteGraphGenerator<>(1, 4); 0.5); ED); Graph(genEdge.class); gen.generate((g); SE HashMapVertexFactory<40 new); assert[][] adj = g 0, 0, { 1, 2 }, { 2, 2 }, { 1, 2 }, { 7, 2 }, { 1, 1 }, { 2, 2 }, { { 2, 2 }, { 8, 3 }, { 3, 7 }, { 3, 5 }, { 3, 3 }, { 3, 8 }, { 5, 5 }, { 4, 4 }, { { 4, 6 }, { 4, 4 }, { 4, 7 }, { 6, 8 }, { 5, 4 }, }; forEquals(ed, 4, g.get"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// If the vertex is free-flowing then (by definition) there is no duration to traverse it.\\n')""]
### Test JUnit in Java:
","@Test public void testWalkTrafficLights() { // Graph with an intersection with traffic lights IntersectionVertex v1 = vertex(""maple_1st"", new Coordinate(2.0, 2.0), false, false); IntersectionVertex v2 = vertex(""maple_2nd"", new Coordinate(2.0, 1.0), false, true); StreetEdge e1 = edge(v1, v2, 1.0, false); IntersectionVertex v3 = vertex(""test2"", new Coordinate(1.0, 1.0), false, false); StreetEdge e2 = edge(v2, v3, 1.0, false); // With traffic lights on both directions assertEquals( 15.1125, calculator.computeTraversalDuration(v2, e1, e2, TraverseMode.WALK, 40, 40), 0.1 ); assertEquals( 15.1125, calculator.computeTraversalDuration(v2, e2, e1, TraverseMode","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow, a anor
:
of a that the,
a
.....
TheThe# is:
##\\ 'J'.
. a.
er.
free the)
is a.. the..
\\
##### Description.
the.
## sierp@
1
areerinerava.
@
QL the
of a,, @section
, v1ver"")"",v"","", ""_al)n)
) \2.5) \) false,
falsesectionV)1) false2verle"",1"","", ""Vordinate)2)0, false2,0, false, false,
false, vy, false12,, v1, v2.0, false, falsesection v v2. false4ver"","") "",ordinate)2.0, false2.0, false, false, Inter v e1 = edge2v,, 2, false1.0, false, Inter falsedraw;. the sides; //ed(v2,,1,,,, 1ates,
,verseal,.1,,v,, e1, eversee,
,e, false1., 4,, false4,0, false
Traed(515.1,,,, 1ator.
Traverseal,(v2, 2, e2, everseMode.Tra"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Add a mapping feedback callback class. If one already exists a runtime\\\\n * exception is thrown.\\\\n * @param mf the mapping feedback callback listener.\\\\n */', '')""]
### 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#
:
##\\//\\\\ is
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:
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * \\\\n * - The Zookeeper quorum and client port is taken from the Hadoop Configuration
\\\\n * - The Kiji instance name is set to KConstants.DEFAULT_INSTANCE_NAME\\\\n * (""default"").
\\\\n * - The table name and column names are explicitly left unset.
\\\\n *
\\\\n *\\\\n * @return A builder configured with this Kiji URI.\\\\n */\', \'\')']
### Test JUnit in Java:
","@Test public void testConstructedUriIsEscaped() { // SCHEMA-6. Column qualifier must be URL-encoded in CassandraKijiURI. final CassandraKijiURI uri = CassandraKijiURI.newBuilder(""kiji-cassandra://zkhost/chost:5678/instance/table/"") .addColumnName(new KijiColumnName(""map:one two"")).build(); assertEquals( ""kiji-cassandra://zkhost:2181/chost:5678/instance/table/map:one%20two/"", uri.toString()); }","nobody################ru
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 * < - \\ Kookeeper URIorum is session port are set from the Kadoop configurationi>zoli>\\\\n *
- The Kiji URI name is taken to thett>kiji.DEFAULT_INSTANCE_NAME\\\\n * (whichtt>k"").\\li>\\\\n *
- The K name is namespace name are set set emptyset.
\\\\n * ul>\\\\n * <\\n * 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
> 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:
[""('/**\\\\n\\\\t * @see org.openmrs.module.webservices.rest.web.api.RestService#getResourceByName(String)\\\\n\\\\t * Should return resource for given name\\\\n\\\\t * Should return resource for given name and ignore unannotated resources\\\\n\\\\t * Should fail if failed to get resource classes\\\\n\\\\t * Should fail if resource for given name cannot be found\\\\n\\\\t * Should fail if resource for given name does not support the current openmrs version\\\\n\\\\t * Should return subresource for given name\\\\n\\\\t * Should fail if subresource for given name does not support the current openmrs version\\\\n\\\\t * Should fail if","@Test public void getResourceByName_shouldFailIfTwoResourcesWithSameNameAndOrderAreFoundForGivenName() throws Exception { List> resources = new ArrayList>(); resources.add(AnimalResource_1_9.class); resources.add(DuplicateNameAndOrderAnimalResource_1_9.class); when(openmrsClassScanner.getClasses(Resource.class, true)).thenReturn(resources); setCurrentOpenmrsVersion(""1.9.10""); expectedException.expect(IllegalStateException.class); expectedException.expectMessage(""Two resources with the same name (v1/animal) must not have the same order""); restService.getResourceByName(""v1/animal""); }","nobody################ru
Hinweisow is a example on will how method of process. a.
a method codeav test case.
### Inst:
Thea'*\\\\\\t\\\\param\\.apacheqars.module.rad..api.Open.controller.vful#getPat(U(String,\\n\\\\t * @p>Description returnstrong> return a with given name\\\\n\\\\t * @strong>Note return null for given name\\ type theavailableated fields\\\\n\\\\t * Should return if resource to find resource for\\\\n\\\\t * Should fail if failed class given name does be found\\\\n\\\\t * Should fail if resource for given name cannot not exist given given versionmrs version\\\\n\\\\t * Should fail resource- for given name\\\\n\\\\t * Should return if subresource for given name cannot not exist the current openmrs version\\\\n\\\\t * Should fail if sub sierpsee annotation void getResourceByName(should_IfResourceResourcesHaveSameNameExDingAn()SivenVersion( throws Exception {\\ Rest > resources = get ArrayList>(); .add(Resourcenot..1.1_class); resources.add(AnoglicateResourceResourceOrderResourceimalResource_1_9.class); List (resourcemrsResourceServiceanner.getResource(An.class)). "")).thenReturn(resources); UpOpenMrsVersion(1.9"");0"");""); whenException.expect(IllegalArgumentException.class); Exception.expectMessage(""Found resources with the same name andAneter.Animal) and have be the same order""); Service.getResourceByName(""v1/animal""); "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Creates new pair of elements pulling of the necessity to provide corresponding types of the\\\\n * elements supplied.\\\\n *\\\\n * @param a first element\\\\n * @param b second element\\\\n * @param the first element type\\\\n * @param the second element type\\\\n * @return new pair\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testUnorderedPairEquals() { Pair p1 = UnorderedPair.of(CUSTOM, new Custom(1)); Pair p2 = UnorderedPair.of(ANOTHER, new Custom(1)); Pair p3 = UnorderedPair.of(ANOTHER, new Custom(2)); Pair p4 = UnorderedPair.of(CUSTOM, new Custom(1)); Pair p5 = UnorderedPair.of(CUSTOM, new Custom(2)); Pair 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\\ =//ated an
(. 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)
Pairp1} PorderedPair.of(CYHER, new Custom)1))
Pair p3 = UnorderedPair.of(ANOTHER, new Custom(1));
Pair p4 = UnorderedPair.of(ANUSTOM, new Custom(3)); Pair p5 = UnorderedPair.of(CUSTOM, new Custom(2)); Pair 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:
[""('/**\\\\n\\\\t * Create an instance for an ireg operation\\\\n\\\\t *\\\\n\\\\t * @param physicalFileAbsolutePath\\\\n\\\\t * {@code String} with the absolute path to the physical file to be\\\\n\\\\t * registered\\\\n\\\\t * @param irodsFileAbsolutePath\\\\n\\\\t * {@code String} with the absolute path to the iRODS file to be\\\\n\\\\t * registered\\\\n\\\\t * @param resourceGroup\\\\n\\\\t * {@code String}specifies the resource group of the resource. This\\\\n\\\\t * must be input together with the resourceToStoreTo\\\\n\\\\t * @param resourceToStoreTo\\\\n\\\\t * {@code String} specifies the resource to store to. This can also\\\\n\\\\t * be specified in your environment or via","@Test(expected = IllegalArgumentException.class) public final void testInstanceNullPhysPath() throws Exception { DataObjInpForReg.instance(null, ""irods"", """", """", false, false, ChecksumHandling.NONE, false, """"); }","nobody################ru
Hinweisow is a example on will how method of process. a.
a method codeav test case.
### Inst:
Thea'*\\\\\\t\\\\ a array of the objectTistry.\\n\\\\t *\\\\n\\\\t * @param opAddressPathsolutePath\\\\n\\\\t * @ Thelink String} the the absolute path of the physical file\\ be created\\n\\\\t * operated\\\\n\\\\t * @param logicalregsFileAbsolutePath\\\\n\\\\t * {@code String} with the absolute path to the iRODS file to be\\\\n\\\\t * registered\\\\n\\\\t * @param iType\\\\n\\\\t * {@code String} withifying the resource group to the i\\\\\\\\n\\\\t * parameter be the to with the i nameRegister.\\\\n\\\\t * param resourceToStoreTo\\\\n\\\\t * {@code String} withifies the resource to store the. This must be be\\n\\\\t * be a as the i variable in the sierp{Propertydata =\\legalArgumentException.class)\\
void void test_CreResourceical() throws Exception { StringStoreInsts dataTestistrationcreate(null, ""testds:// "" "" "", false, falsesumTypeling.NONE, null, false""); "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Adds a data item to the series.\\\\n *\\\\n * @param x the x-value.\\\\n * @param y the y-value.\\\\n * @param deltaX the vector x.\\\\n * @param deltaY the vector y.\\\\n */', '')""]
### 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""] =//itional the comment to
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:
[""('/**\\\\n * Parses the program arguments and returns the corresponded command object.\\\\n * @param args the program arguments\\\\n * @return the command object, or {@code empty} if there are no commands to execute (e.g. help)\\\\n * @throws ParameterException if arguments are not valid\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void simple() { JCommanderWrapper> commander = new JCommanderWrapper<>(""PG"", new Cmd(""R"")); Optional 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\\ =//agraph.. corresponding.. the the argumentent to..
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<
; 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:
[""('', '// Check if the document has a bound grammar.\\n')""]
### Test JUnit in Java:
","@Test public void checkDocumentWithXSIDocTypeBoundGrammar() throws Exception { MockXMLLanguageServer languageServer = new MockXMLLanguageServer(); String xml = """"; String xmlPath = getFileURI(""src/test/resources/tag.xml""); TextDocumentIdentifier xmlIdentifier = languageServer.didOpen(xmlPath, xml); String xsdPath = getFileURI(""src/test/resources/xsd/tag.xsd""); Boolean actual = (Boolean) languageServer.executeCommand(CheckBoundGrammarCommand.COMMAND_ID, xmlIdentifier, xsdPath).get(); assertNotNull(actual); assertEquals(false, actual); }","nobody################ru
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://www.w3.org/2001/XMLSchema-instance\ xsi:schemaNamespaceSchemaLocation=\""http.xsd\"">""; language expectedWith = ""ClassPath(""tag/test/resources/tag.xml""); languageDocument document textDocument = newServer.getOpenDocumentxmlPath, xml); language expectedsdPath = getFileURI(""src/test/resources/tag/tag.xsd""); Text x = languageBoolean) languageServer.didRequest(newDocumentGrammarCommand.COMMAND_ID, xmlIdentifier, xsdPath);getResult assertTrueNull(actual); assertTrue(true, actual); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Check whether a collection of AvroSchema objects contains a given AvroSchema element, resolving\\\\n * UIDs using the given KijiSchemaTable.\\\\n *\\\\n * @param schemaTable KijiSchemaTable with which to resolve schema UIDs.\\\\n * @param schemaCollection collection of AvroSchemas to check for the presence of the given\\\\n * element.\\\\n * @param element AvroSchema for whose presence to check in schemaCollection.\\\\n * @return whether schemaCollection contains element after resolving UIDs using schemaTable.\\\\n * @throws IOException in case of an error reading from the schema table.\\\\n */', '')"", ""('', '// If none match, return false.\\n')""]
### 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 stringList = Lists.newArrayList(stringJSONAS, stringUIDAS); final List 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/** '/**', the of, return false.',n',"",
### Ex CaseUnit: the:
sierpTest
void testContainsroSchemaCollectionContains() throws IOException {
KijiSchemaTable schemaTable = newSchemaijiSchemagetSchemaTable("" final List schemaId = schemaTable.getUIDCreateUIDUID(""String_SCHEMA_ final long intUID = schemaTable.getOrCreateSchemaId(INT_SCHEMA); final long schemaSchema = ""ING_SCHEMA.to(); final String intJSON = INT_SCHEMA.toString(); final ListroSchema stringSchema = = AvroSchema.fromBuilder().setSchemaid(stringUID).set(); final AvroSchema intUIDAS = AvroSchema.newBuilder().setU(stringJSON).build(); final AvroSchema intUIDAS = AvroSchema.newBuilder().setUid(intUID).build(); final AvroSchema intJSONAS = AvroSchema.newBuilder().setJson(intJSON).build(); final List schemaSch = Arrays.newArrayList(stringUIDAS, stringUIDAS); final List intList = Lists.newArrayList(intJSONAS, intUIDAS); final ListasList(), Arrays.asList()); assertThat(similarity).isEqualTo(1.0, DELTA); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow::
or
:
of a
the:
a
to...
BelBel#
##Instm
'
.
' an10
to
-
-\\\\
#####
## sierpJ
@
the,ilar
@
@
, adim,ens
,ities
ilarest@, '{,s>
,<
<,Test>
,<
F@,b,,
.<\\\\n\\\\t *
\\\\n\\\\t * This method calls {@link ModuleUtil#checkRequiredVersion(String, String)} internally.
\\\\n\\\\t *
\\\\n\\\\t * The require version number in the config file can be in the following format:\\\\n\\\\t * \\\\n\\\\t * - 1.2.3
\\\\n\\\\t * - 1.2.*
\\\\n\\\\t * - 1.2.2 - 1.2.3
\\\\n\\\\t * - 1.2.* - 1.3.*
\\\\n\\\\t *
\\","@Test @Verifies(value = ""should not match when version has wild card plus qualifier and is outside boundary"", method = ""matchRequiredVersions(String version, String versionRange)"") public void matchRequiredVersions_shouldNotMatchWhenVersionHasWildPlusQualifierCardAndIsOutsideBoundary() { String openmrsVersion = ""1.*.4-SNAPSHOT""; String requiredVersion = ""1.4.0 - 1.4.10""; Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredVersion)); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Inst Theow. a anor
the
of a that a,
a
.....
TheThe# #:
##\J
nn\\nn\\', is is an instructionancement. thethis This\e}1, String,
String a. thenn\\tt\\ Thiscard*\\ wild wild.
\\ />
nn\\tt\\\\br />
nn\\\\\\\\\\ method is thelink#}ity}}}}String, String, and.
br>
nn\\tn* Thisbr>\\nn\\\\n*\\ method of.. the... be a the file..\\\\\\\\n\\\\br>\\nn\\tt\\\\br>\\.
.1.li>\\nn\\\\n\\
\\.2.- \\nn\\\\n\\
\\.2.3.11.2.2.li>\\nn\\\\n\\ - 1.2.<11.2.
- \\nn\\tn\\
- 1n sierp!
Testify
1) valuevalue"")"")"")"")"") changedcard1"")ify"") wild a"")) value, ""shoulded"""""""")value,) String,))
@ static
Versions(1_,erMatchMatchWildCardCardifier,inalWWerBoundary,
@ []}orph}} ""should""""1.1APSAPH V = ""1.1.5.SN1.0.5.. StringStringion1ed;value).javaing,ersions_Stringm,,, StringV, "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Loads the Pretty Faces configuration and returns the configuration\\\\n * object.\\\\n * \\\\n * @return Loaded configuration.\\\\n * @throws IOException\\\\n * If configuration could not be read.\\\\n * @throws SAXException\\\\n * If configuraion could not be parsed.\\\\n */', '')"", ""('', '// Load configurations from the class path\\n')"", ""('', '// Load configurations from the config files configured in the servlet\\n')"", ""('', '// context\\n')"", ""('', '// Load configuration from the default path\\n')""]
### 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 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/** '/**', the\\ the givenpath.\\',"", ""('', '// Load configurations from the class file\\ in the application contextn')"", ""('', '// Load.n')"", ""('', '// context configurations from the context context\\n')"",
### Ex CaseUnit: Eclipse:
sierpTest
void test()() throws IOExceptionAXException, IOException { { Pre ConfigurationletContext contextContext = getasyMock.createMockiceMock(ServletContext.class); finalasyMock.expect(servletContext.getInitParameter(""EttyF.DEFAULT_FILE_PATHT)).andReturn(null).anyTimes(); EasyMock.re(servletContext.getInitAsStream(PrettyFilter.ator.DEFAULT_CONFIGTTY_CONFIGACES_CONFIG_andReturn(null new).anyTimes(); E PreLoader classLoader = E ClassClassLoader(new URL[]0], null.currentThread().
.getContextClassLoader()); { @Override public URLumeration getResources(final String name) IOException { return (namettyConfigurator.DEFAULTTTY_F_FILESOURCE_equals(name)) { return newation(new(ttyConfig());); } return { return super.getResources(name); } } }; E PrettyConfigurator configurator = new PrettyConfigurator(resourceContext, { @Override public PreLoader getResourceLoader()"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * @return the chronologically (based on result date) first result\\\\n\\\\t * @should get the first result given multiple results\\\\n\\\\t * @should get the result given a single result\\\\n\\\\t * @should get an empty result given an empty result\\\\n\\\\t * @should not get the result with null result date given other results\\\\n\\\\t * @should get one result with null result dates for all results\\\\n\\\\t */', '')"", ""('', '// default the returned result to the first item\\n')"", ""('', '// in case all resultDates are null\\n')""]
### 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:
[""('/**\\\\n *
\\\\n * detectDataFileType.\\\\n *
\\\\n *\\\\n * @param fileName a {@link java.io.File} object.\\\\n * @return a {@link io.github.msdk.datamodel.FileType} object.\\\\n * @throws java.io.IOException if any.\\\\n */', '')"", ""('', '// Parameter check\\n')"", ""('', '// To check for Waters .raw directory, we look for _FUNC[0-9]{3}.DAT\\n')"", '(\'\', ""// We don\'t recognize any other directory type than Waters\\n"")', ""('', '// Read the first 1kB of the file into a String\\n')""]
### 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 * \\\\n * <\\n *