| inputs,targets,outputs
|
| "### 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 testDoesNotContainThrowsForNullSubject() { VerifiableByteArray<IllegalArgumentException> verifiable = getVerifiableInstance(null); Assertions.assertThrows(IllegalArgumentException.class, () -> verifiable.doesNotContain((byte) 0)); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',param : value to be up in the list',\n * @n * @return the index of it is not exist the value,\\\\n',*',n',*',throws NullNo the subject does not. the not the value.\\\\n')*' |
| )"". |
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| shouldFindNotContainValueirteenXValue()() { |
|
|
| ifyTestArrayOutputStringlegalArgumentException>().ifiableByte newIlifiableByte(Il); assertert..assertEqurown(IllegalArgumentException.class, ver -> verifiable.contNotContain(Il[ 0), } |
|
|
|
|
| "
|
| "### 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 testGraph3b() throws UnsupportedEncodingException, ExportException, ImportException { Graph<Integer, DefaultEdge> orig= NamedGraphGenerator.klein3RegularGraph(); String res = exportGraph(orig, Graph6Sparse6Exporter.Format.GRAPH6); Graph<Integer, DefaultEdge> g = importGraph(res); this.compare(orig, g); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test case for |
|
|
| def Conclusion: |
| ThisHelloHello '',',leGr:igatorsices are the single location',n',"", |
|
|
|
|
| Function Example caseUnit: action: |
| [""Test |
|
|
| void test__()() { ExceptionsupportedOperationodingException { IOException { Exception { |
|
|
| gString, StringD> gaminewGraph.ator.generittens_bGraph(); |
| input = graphGraph3orig); ""Gener);wingGraph);porter.DE.JAPHML_ assert<Integer, DefaultEdge> exp = GraphGraph(res, assert.assertare(g, g); }} |
|
|
| "
|
| "### 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 testInstanceNullColumnNames() { AbstractAliasedQuery simpleQuery = Mockito.mock(SimpleQuery.class); @SuppressWarnings(""unchecked"") List<IRODSQueryResultRow> results = Mockito.mock(List.class); List<String> columnNames = null; IRODSSimpleQueryResultSet.instance(simpleQuery, results, columnNames, false); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ method creation.' be a instance instance of the class type. *n\\\\t * Ifn't * Theparam argsInput simplen\\\\t * @\\\\@param #.j..jae.exec.exec.QueryQuery}@ will the instancen\\\\t *instanceinstance set.\\\\n\\\\t * return simpleQueryn\\\\t * that@link ArrayResultResult<Object>>} that the specified of the formatcolumn format.\\\\n\\\\t * @param columnsNames\\\\n\\\\t * {@code List<String>} of the column for the column.\\\\n\\\\t * @param queryNull\\\\ords\\\\n\\\\t * {@code boolean} indicating indicates whether there are more records to ben t * addrieve from\\\\n\\\\t * return *@code orgODSyntpleQuery}Set} objectn')t */""] |
| ] |
|
|
|
|
|
|
| Note Example caseUnit Code Python: |
| Test |
| timeout= NoneArgumentException.class) |
|
|
| void test__()s() { |
| |
| ListSuppressWarnings(""unchecked"") simple<ListODSSInstanceResultSet> results = newito.mock(List<class); results<List> columnNames = Mock; assertODSimpleQueryResultSet resultexecute =simpleQuery, results, columnNames, true); } |
|
|
|
|
| "
|
| "### 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 analyseWithEmptySourceFiles() { delphiProject.getSourceFiles().clear(); DebugSensorContext context = new DebugSensorContext(); sensor.analyse(project, context); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\',This |
| agram the words: flying the andn *' |
| ] |
|
|
|
|
| Function |
| theoke test the code |
| #param |
|
|
| static test_Python string()( -> |
|
|
| ight |
| ileappend_Code()index() |
| #PrintData(. new JOutputData(); |
|
|
| ensor_ |
| ze_text) context) |
| |
|
|
| "
|
| "### 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 ensureSecondStageRoleAndBossRoleCanBeSelectedBoth() { final PersonPermissionsDto personPermissionsDto = new PersonPermissionsDto(); personPermissionsDto.setPermissions(List.of(USER, BOSS, SECOND_STAGE_AUTHORITY)); sut.validatePermissions(personPermissionsDto, errors); verifyNoInteractions(errors); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello '',', you ==,', the it one one is be active',n'"", |
| ('Hello ' |
|
|
| If Example caseoke test action code |
| [""Test |
|
|
| test_aryT()In((BeLaunlected()S { |
|
|
| int personmission objectTO otherPermissions =to = new PersonPermissionsDto("" |
|
|
| PermissionsDto.setFirstmission(""ro.of(""new_ INOB, JRET_STUD);METHODUTHORITY, |
| assertolution.addatePermissions(personPermissionsDto, ""List assertify(Duaction(person, |
| } |
|
|
|
|
| "
|
| "### 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 |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ a valid digits of conc their Ham-Merence between between\\\\n')t * Theparam v1: vector 1 1\\\\\\n\\\\t * @param v2 binary vector number 2.\\\\n\\\\t * @return binary Pattern-difference distance between\\\\n')t *"", |
| ][ -> |
|
|
| ["" Example caseUnit::: |
| @Test |
| public TODunit_j |
| int[] v2 = new int[]{1,0,0,0,0,0,0,1}; intert..assertEququal(snew1, v2,}Pattern d = PatternDifferenceDistancepattern(v1, v2);}Asserts.assertEquals(res, 0.025);}} |
|
|
|
|
| "
|
| "### 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 testLevelInvalidFirstUrlAnswer() { String userName = ""lessonTester""; try { |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello '',',',let',', Initial',n',"", |
| ('', ' |
|
|
| ### Example CaseUnit: action: |
| @Test |
| |
|
|
| urlInput = ""Johnon"";utorial""; |
| String { URL intentionally that Nameists |
| Level |
| LevelUser();.testifyUserLevelExuser,, userName, ""Id, }} Check up User User user |
| GetIninfo(""Success in in as normal + userName + ""..."" Level Formlet""); |
| "
|
| "### 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 thirdStepPutGetDoubleReturnsValue() { PreferencesFactory.create() .module(DummyModuleScope.class) .key(""dummy.key6"") .put(1.2345d); double result = PreferencesFactory.create() .module(DummyModuleScope.class) .key(""dummy.key6"") .get(5.4321d); assertEquals(1.2345d, result, 0); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ a game*** \ast to a moon person point the given's but from |
| \ |
| against and the morning.0code i Name\\\n"",* and\\\n * @param:The total character that the story. {firstcode stepStep}!n * @param:04.05.0\\n"",* @end\.1.0')n"",* @param (Johnithqiam Dawn *"", |
| ]'' |
| """""""""""" |
| theUnit test action code |
| [""Test |
|
|
| static test_()namHappy_Correct() { |
|
|
| ixStep fj_}} |
| @oubFactory..class) |
| =runSetFirstummy"")class"")"") |
| .method(""@,0);67; |
| . d = Factory.create(). |
| .get(DummyModuleScope.class) .get(""dummy.key5"") .getDouble1.6721d); |
| assertEquals(5.2345d, 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(groups = ""unit"", expectedExceptions = { IllegalArgumentException.class }) public void testIsPrimitiveArrayErrorCondition() { ReflectionUtils.isPrimitiveArray(null); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
| Example Example: |
| YouHello\\',\\ function returns that the number of missing a data,.i,][ double[], double[ ) double on) |
| n""*/ It\\\n""* @param s:n - @The type of the not be checked for\\\\n * @param:Y>True</code> |
| the is a primitive data,,\\\\n *"", |
| ) |
|
|
| [ |
| theoke test action code |
| [""Test |
| expected: ['def"") marks_pr = [''ArgumentException,class }) |
|
|
| static test_Arrayitive_((( -> |
|
|
| lect.ils.array_itiveArray([');}} |
|
|
|
|
| "
|
| "### 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 testSearchSelect() { EasyMockSupport support = new EasyMockSupport(); BiMap<SearchResult, Geometry> map = createBiMap(); BiMap<SearchResult, Geometry> labelMap = createBiMap(); ControlRegistry controlRegistry = createControlRegistry(support); DynamicViewer viewer = support.createMock(DynamicViewer.class); ViewerAnimatorCreator creator = createCreator(support, viewer, 1); MapManager mapManager = createMapManager(support, viewer); SearchModel model = new SearchModel(); model.getAllResults().add(map.keySet().iterator().next()); model.getShownResults().add(map.keySet().iterator().next()); support.replayAll(); SelectedResultHandler handler = new SelectedResultHandler(model, controlRegistry, mapManager, map, labelMap, creator); model.getFocusedResult().set(model.getAllResults().get(0)); assertEquals(Color.CYAN, ((ColorRenderProperties)map.values().iterator().next().getRenderProperties()).get"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',rict the to input and *n *', ')""] |
|
|
|
|
| ### Example caseUnit Code command: |
| @Test |
|
|
| void test_Forive {{ 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 qnameNamed() { Element control = doc.createElement(FOO); Element controlNS = doc.createElementNS(SOME_URI, FOO); Element test = doc.createElement(FOO); Element testNS = doc.createElementNS(SOME_URI, FOO); assertFalse(ElementSelectors.selectorForElementNamed(new QName(BAR), ElementSelectors.byName) .canBeCompared(control, test)); assertTrue(ElementSelectors.selectorForElementNamed(new QName(FOO), ElementSelectors.byName) .canBeCompared(control, test)); assertTrue(ElementSelectors.selectorForElementNamed(new QName(SOME_URI, FOO, XMLConstants.DEFAULT_NS_PREFIX), ElementSelectors.byName) .canBeCompared(controlNS, testNS)); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1Hello"","",*This\\lies the given JDaryor tos filter to the only if the givenn * current boolean is the specified valuebo) value. Ifn * Returnsparam elementName theName of the element element.n * @param name expected ElementSelector object be forn * @param the result objector objectn *"", |
| voidn'] |
|
|
|
|
| [' Example caseUnit Code:: |
| @Test |
|
|
| void test1_amingElement { |
|
|
| Select = new.getElement(""qO); ElementSelect2 = control.createElement((QUCH_N, ""Q); ElementSelect = doc.createElement(QUO); testSelectNS = doc.createElementNS(SOME_URI, FOO); ElementEqu(esSelector.isorNameName(amed(control StringName(""controlODY), control controlSelectors.QUName(!=.isSelectApp(control, test)); assertTrue(ElementSelectors.selectorForElementNamed(new QName(FOO), ElementSelectors.byName) .canBeCompared(control, testNS assertTrue(ElementSelectors.selectorForElementNamed(new QName(BUB_URI), BAROO), BAR ""ML),ants.NFAULT_N),URIREFIX), Element ElementSelectors.byName) .canBeCompared(control,, testNS)); } |
|
|
|
|
| "
|
| "### 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 testMakeMenuBarWhenItDoesNotContainAllMenuItems() { editor.menuItems = new HashSet<>(); editor.makeMenuBar(); verify(menuBuilder, never()).addSave(any(Command.class)); verify(menuBuilder, never()).addCopy(any(ObservablePath.class), any(Validator.class), any(Caller.class)); verify(menuBuilder, never()).addRename(any()); verify(menuBuilder, never()).addDelete(any(ObservablePath.class), any(Caller.class)); verify(menuBuilder, never()).addValidate(any()); verify(menuBuilder, never()).addNewTopLevelMenu(any()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ you have to learn the instructions item, this cell.\n"",*/"", |
| ) |
|
|
|
|
|
|
|
|
| Function Example caseoke test action code |
|
|
| Test |
|
|
| static test_MagicItem()Done_ntExainTheAItems( { |
|
|
| .rot = = ["" ArraySet[String(); |
|
|
| .addMagic('( |
| |
|
|
| ify(menuBuilder, ""()).addMove(about(Questionerverable..C)) any);Obsator.class). '(Editorable.class)) |
| verify(menuBuilder, never()).addCopyear('any( verify(menuBuilder, never()).addCopy(any(ObservablePath.class)) any(Editorer.class), |
| verify(menuBuilder, never()).addCopyidate();any( verify(menuBuilder, never()).addCopy();Action(Itemany( |
| } |
|
|
|
|
| "
|
| "### 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 testGetLastMillisecondWithCalendar() { Hour h = new Hour(21, 21, 4, 2001); GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY); calendar.setTimeZone(TimeZone.getTimeZone(""Europe/Frankfurt"")); assertEquals(987890399999L, h.getLastMillisecond(calendar)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ the sum characterond of the yearglass *"",n * @param #get_DayisecondFor andn *"", |
| ] |
|
|
| """""""""""" Example caseVM test action |
|
|
| [""Test |
|
|
| static test_FirstMsisecond_Calendar() { |
|
|
| Cal = new Hour(0, 30, 0, 0, |
|
|
| orianCalendar g = new GregorianCalendar();hale.FRMANY_ |
|
|
| endar.set(((TimeZone.getTimeZone(""UTC/Parislin"")); |
|
|
| Equals(21,,00,,, calendar.getLastMillisecond());calendar)); |
| returns changing pointer |
|
|
| { calendar |
| .setFirstMillisecond(new); assert(""Null calendarinterException"");Exception not thrown raised."" the input."" } catchcatch (NullPointerException e) { assert} handleird a be to this}} |
| } |
|
|
|
|
| "
|
| "### 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 retrieveTokenKeysForZone_responseNotOk_throwsException() throws IOException { String errorDescription = ""Something went wrong""; CloseableHttpResponse response = HttpClientTestFactory .createHttpResponse(errorDescription, HttpStatus.SC_BAD_REQUEST); when(httpClient.execute(any(), any(ResponseHandler.class))).thenAnswer(invocation -> { ResponseHandler responseHandler = invocation.getArgument(1); return responseHandler.handleResponse(response); }); assertThatThrownBy(() -> cut.retrieveTokenKeys(TOKEN_KEYS_ENDPOINT_URI, PARAMS)) .isInstanceOf(OAuth2ServiceException.class) .hasMessageContaining(errorDescription) .hasMessageContaining(""Request headers ["") .hasMessageContaining(""x-app_tid: 92768714-4c2e-4b79-bc1b-009a4127ee3c"") .hasMessageContaining(""x-client_id: client-id"") .hasMessageContaining(""x-azp: azp"")"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello', is a to errorHash*/ **/ */ using of is is required, thisn'n Identityt thet thet continue app is be any Identity Service AppId.'.' value is to be signed ton\\t\\t\\t\\t\\ the Identity and of\\') |
| )""] |
|
|
| ### Example caseUnit Code:: |
| @Test |
| public void test_()()IdIdId()Proof()inrows_() { ExceptionException { |
|
|
| tokenString = ""Error went wrong while StringableReaderClient http = newttpResponse....createHttpResponse(HttpDescription); ""ttpResponseCodeINIENTSERAD_REQUEST); Http (HttpStatusTestsendRequestrequestHttp response(),HttpContent.class),);thThrow(Httpocation. responseifHttpHandler.Handler = (.getResponseument(Response); Http responseHandler.get();(Http);});});}}((rows:(response -> response(findainTokenKeysForresponseKEN_KEYYS_ARDPOINT,URL, ""AM_""..isEmpty();[Tokenuth2TokenToken.class);});.isMessage(""ains(errorDescription); .isLocation(aining(""The failed areId .hasMessageContaining(""Id-am2idok"")"")"")"")"")"")a"")8f-4d8-a3d-dd7dde"")"") .isMessageContaining(""x-app_id: <_id"") .isMessageContaining(""x-zonep: clientp"") |
| "
|
| "### 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 matchesPathWildcard() { |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1Hello"","",*This this following thing exist a expectedScripts requirements?i the for wildcards)? recursives)?*/n"",*/"",n"",*/ Ifparam path The Path to the to\\n *\\\\param argsPath PathPath of check against\\\\n * @returns if the,\\\\n"")*' |
| [""n] '\\') \'\do comments except |
|
|
|
|
| ### Example caseUnit::: |
| @Test |
| |
| |
|
|
| True(mat.icitils.matchesPathWild/Pathpath ""path"")); |
| }True(ActionImplUtil.matchesPath(""some*"", ""other*"")); assertTrue(ActionImplUtil.matchesPath(""some*"", ""someY"")"")); assert multiple wild*' matchescard no not exact a |
| assertTrue(ActionImplUtil.matchesPath(""some*"", ""some/thing); assertFalse(ActionImplUtil.matchesPath(""some*"", ""some/hing"")"")); assertFalse(ActionImplUtil.matchesPath(""some*"", ""someTthinghinging"")); assert multiple 'card,assertTrue(ActionImplUtil.matchesPath(""some*"","","",uff"", ""some*Stuff"")); assertTrue(ActionImplUtil.matchesPath(""some*Action*Stuff"", ""someActionStStStuff"")); assertTrue(ActionImplUtil.matchesPath(""some*Action*Stuff"", ""someTActionActionXYZStuff"")); assertTrue(Action |
| "
|
| "### 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 testGetPerspectiveFromPlaceWithParams() { final String perspectiveName = ""eccePerspective""; final String bookmarkableUrl = perspectiveName .concat(""|~screen1,~screen2""); final PlaceRequest req = new DefaultPlaceRequest(bookmarkableUrl); req.addParameter(""param"", ""value""); PlaceRequest place = BookmarkableUrlHelper.getPerspectiveFromPlace(req); assertNotNull(place); assertNotSame(req, place); StringBuilder expected = new StringBuilder(perspectiveName); expected.append(""?param=value""); assertEquals(expected.toString(), place.getFullIdentifier()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a code |
| oke test cases for |
| Example |
| : |
| YouA\\',\\ a list, robot, is generates a string object objectn""* |
| the given ofn * ofparam s:nn * andparam:n"",*/"" |
| ) |
|
|
| """""" |
| theoke test action code |
| Test |
|
|
| static test_Cononsive_TheholderCommentrot( -> |
|
|
| int url = = ""Johnstatic""pectiveExample |
|
|
| int message = = = ""Name. |
|
|
| cat(""pers !_\ \2, |
|
|
| intRequest place = new PlaceDRequest(persmark,Url, |
|
|
| .setBook(""pers1 """"This1 |
| reqRequest end = newmarkable...getPerspectiveFromPlace(book, |
|
|
| EquEmpty(place. |
| returnTrueEmpty(place, bookmark"", |
| assert bookmark s = new StringBuilder(""bookpectiveUrl); int.insert(""|param=value""). returnEquals(place.toString(), placeplace.getBookURLifier()); |
|
|
|
|
|
|
| "
|
| "### 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 testGetPluginKeyBundle() { Dictionary<String, String> headers = new Hashtable<String, String>(); headers.put(Constants.BUNDLE_VERSION, ""1.0""); headers.put(Constants.BUNDLE_SYMBOLICNAME, ""foo""); Bundle bundle = mock(Bundle.class); when(bundle.getSymbolicName()).thenReturn(""foo""); when(bundle.getHeaders()).thenReturn(headers); assertEquals(""foo-1.0"", OsgiHeaderUtil.getPluginKey(bundle)); headers.put(OsgiPlugin.MAERA_PLUGIN_KEY, ""bar""); assertEquals(""bar"", OsgiHeaderUtil.getPluginKey(bundle)); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1Hello"","",*This\\ the value for for the given.n * @\\>\\\\n"",* @: Thisly copied from\\\\@link #.jven.plugins.get..plugins.BridgeKeyundle'il. do is bet befullyn * with code. to security a circularical dependency dependency.\\Ifsure that dependencies dependencies are used your with\\\\n *"",n"",*\\\\param bundleId bundle bundle ton * @param The plugin key from or be null.'n */ @return:.0\\0*/n',*/'] |
| (""n] |
|
|
|
|
| [' Example caseUnit Code action: |
| @Test |
|
|
| void test_PluginKey()undleUt { |
|
|
| epend<String, Object> bundle = new DictionaryMap<String, String>(); headers.put("" ""ants.PLUNDLE_KEY, ""1.0""); headers.put(Constants.BUNDLE_PLSTEMOL,_, ""ma""); headersundleUt = newPluginConstundleUtclass); b (bundle.getPluginmbololsName(). ==equComp(foo""); headers(bundle.getVersioners().).thenReturn(headers); assertEquals(""1"",1.0"", bundlegiBridge.ils.getPluginKey(bundle)); b.put(ConstgiHeaderUtVERSIONERA_VERSIONUGIN_VERSION, ""bar""); bEquals(""bar- bundlegiHeaderUtil.getPluginKey(bundle)); } |
|
|
|
|
| "
|
| "### 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 testSimpleNoFailFastRelease() { Whitebox.setInternalState(ReactBuildConfig.class, ""DEBUG"", false); ModuleSpec.simple(ComplexModule.class, mock(ReactApplicationContext.class)); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\',This |
| mathifier the: the smile value. |
| n"",This' |
| ] |
|
|
|
|
| Function |
| theoke test the code |
| #Override |
|
|
| static test_Caseise()Food( -> |
|
|
| box { |
| TextLinksChangesfalsevers:.)FA) 'Hello"") "") |
| |
| _ReparableForm):class) ""_thisact):):):class) |
| |
|
|
|
|
| "
|
| "### 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 hasElementPropertiesNullRequestFalse() { Assert.assertFalse(RequestObjectHelper.hasElementProperties(null)); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
| a code |
| oke test case for |
|
|
| def Conclusion: |
| ThisHelloHello',*"", |
| ) |
|
|
| [""[' Example caseUnit: action |
|
|
| [""Test |
|
|
| void test_Properties__()() { |
|
|
| ert.assertFalse(has...hasElementProperties(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 getTypedPropertyValueNonTypedDoubleParen() { Object typedPropertyValue = ElementHelper.getTypedPropertyValue(""(5R)-5,6-dihydro-5 (in DNA)"", false); Assert.assertNotNull(typedPropertyValue); Assert.assertEquals(""(5R)-5,6-dihydro-5 (in DNA)"", typedPropertyValue); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', in string name and and a input and returns to set it asn as into a corresponding type type. the.'s Typesing rules Ifn *', |
| ) -> |
|
|
|
|
| ### Example CaseUnit Code:: |
| @Test |
|
|
| void test_edPropertyValue()Stringed()()arss { |
|
|
| resultValueValue = ""Tree.getTypedPropertyValue(""httpsa.2(D5F7,ydrogensh6,10valid) ""); assertert.assertEquNull(typedPropertyValue); assertert.assertEquals(55.)-5,6-dihydro-5"",in DNA)"", ElementPropertyValue. } |
|
|
|
|
| "
|
| "### 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 testIllegalArgument2() { TimeSpan.get(Long.MAX_VALUE, Milliseconds.ONE); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| Example Example: |
| YouHello\n \\ True string objectan object with the given date in each the and end |
| |
| n""*/"", |
| ] |
|
|
|
|
| Function |
| theoke test action code |
| ['Test |
| time_ 3ArgumentError.class) |
|
|
| static test_legalInputumentException() ->{} |
| Unitan tvalueTimei.MAX_VALUE) 12isecond[MAX_ |
| } |
|
|
|
|
| "
|
| "### 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 |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ a valid values, multiplied their cross- between\\\\n't * Theparam v1: 1 1\\\\\\n\\\\t * @param v2 vector number 2.\\\\n\\\\t * @return Chi Chi distance between\\\\n')t *"", |
| ][ ""(' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| "",throws UnArgumentException if thecode>buffer</code> is not""]""Case{ void testBytesBuffer()Native(()""]""] |
| ); -> assertEquEquals(values,uf.as(), ptr.getByteBuffer()0, length)) 4)));); }"", |
| "
|
| "### 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 = JsonException.class) public void testVisitBooleanOnIOException() { final JsonSerializationVisitor visitor = new JsonSerializationVisitor( new ThrowingWriter(), true); visitor.visitBoolean(""a"", false); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\ \ |
| first#$structit_String"")n * |
| b> |
| n * fl by the the closing string of the list value- the endn * first's in the function is created. |
| n * Itdiv></\n""* |
|
|
| ) |
|
|
|
|
| >>> |
| theoke test the code |
| #param |
| int_ TrueokeObject)string_ |
|
|
| static test_Alllean(TheError( -> |
|
|
| intsonElementizable.itor { = new JsonArrayizableExceptionitor({map |
| JirException()) |
| ) |
|
|
| itor_setit(lean(Hello"") "") |
|
|
|
|
|
|
|
|
| "
|
| "### 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 extractSchemaVersionDefaults() { Pair<MigrationVersion, String> info = MigrationInfoHelper.extractVersionAndDescription(""V9_4__EmailAxel.cql"", ""V"", ""__"", "".cql""); MigrationVersion version = info.getLeft(); String description = info.getRight(); assertEquals(""9.4"", version.toString()); assertEquals(""EmailAxel"", description); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',s the first from number version name from a Java file. as a.2_3.extn')* @n *\\\\param <Name: name name to extract.\\ be start any underscores or wild."")\\\\n *\\\\return schema TheThe prefix name to Onlyn * @return versionator The migration separator.\\\\n * @return suffix The migration suffix.\\\\n * @return The schema schema version and\\\\n""]* @throws ExceptionExceptionigrException If the migration name is not match the expected..""\\\\n""]*"", |
| ][ |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| \', \'\')', ""('', ' |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testWithNamespaceSparql() { String serviceEndpoint = Config.DEFAULT_ENDPOINT + ""/namespace/NAMESPACE/sparql""; String normalizedServiceURL = BigdataSailFactory.testServiceEndpointUrl(serviceEndpoint); assertEquals(remoteRepositoryNamespaceUrl, normalizedServiceURL); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisA'\\*/',* secutience Methods', calculate for user of the code patternization rulesn * to.'\\n * Example\\\n * Thisparam fnY href='https: |
| Goodn |
|
|
| / '',', are a closer of all comment\?',n "", |
| """""""""""" Output caseUnit test action code |
| ['Test |
|
|
| boolean test_Java()()ensitiverow() -> |
|
|
| url = = = ""ureJFAULT_SERVOINT;'space/testAMESPACE:testparql""; |
| |
| conDataSailFactory.normalServiceURLpoint((""serviceEndpoint); |
| SystemEquals(""serviceEndo.pace(""("" normalizedServiceURL); |
| } |
|
|
|
|
| "
|
| "### 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 testMaximumTimeMillisecondsViaSetter() { final Random random = new Random(System.currentTimeMillis()); final Distinct.Builder b = new Distinct.Builder(); b.key(""foo""); final long value = random.nextLong(); b.setMaximumTimeMilliseconds(value); final Distinct command = b.build(); assertThat(command.getMaximumTimeMilliseconds(), is(value)); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', the sum value of money ( sleep the Java to run. the devicen * clock, it is interrupted.\\n',*',n',*',param The maximum amount of time in wait the command to run on the Servern * ServerServer before it is aborted.\\\\n *',n * @param:ose 2.2,n *' |
| )""] |
|
|
| ### Example caseUnit Code Python: |
| @Test |
|
|
| void test_Time()isonds()M()() { |
|
|
| Set r = new Random();System.currentTimeMillis()); final SetinctSetT builder = new Distinct.Builder(); b.useSettest""). b int start = b.nextLong(); b.setMaxTime(iseconds(value); assert AssinctResult = new.build(); finalEqu(command.getTimeTimeMilliseconds(), is(long)); } |
|
|
|
|
| "
|
| "### 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_delimited() { TabularTextFormat format = TabularTextFormat.builder() .build(); String[] results = write(format, new String[][] { { ""A"", ""B"", }, { ""C"", ""D"", }, }); assertThat(results, is(new String[] { ""A\tB"", ""C\tD"", })); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ the string string object\n * Aparam: length string objectn"",*/"", |
| ] |
|
|
|
|
|
|
|
|
| Function Example caseUnit test action code |
| [""Test |
|
|
| static test_allightiter_ -> |
|
|
| ooPrInputSy_ newularFormFormat();class(); |
|
|
| set("" |
|
|
| expected tests = format_in, "" int[]][]{ |
| "" ""hello"", ""B"", "" |
| { ""C"", ""D"", }, "" assertThat(results, is(build String[ { """"A\tB\ """"C\tD"", "")); } |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| ['(\' |
| |
| |
| |
| |
| )**/\\\\\\\\\\\\ check if correctness of input string** * given featureparamcode #}**words must meet atn t< at-empty and\\\\ strength\\ is { by a variables. {n\\\\t * \\prop>><Password"">< for\\n\\\\t * <tr><\\\\n\\\\t * <td>Password</th><\\\\n\\\\t * <td>Strength</th>\\\\n\\\\t * <th>Value</</th>\\\\n\\\\t * <tr>\\\\n\\\\t * <td><\\\\n\\\\t * <td>Strengthirement</</ be be any password@link #} passwordnns password</ password password.</n\\\\t * andth>Strengthn\\\\t * <@link UserIDld.ants.ProropPASSWORD_MIN__MATCH}USERNAME_AND_SYSTEM_}\\\\th>\\\\n\\\\t * <td>Strength</th>\\\\n\\\\t * <tr>\\\\n\\\\t * <tr><\\\\n\\\\tparam</\"": <PasswordExceptionStrength.class)>\\\\Testb thatexpected = InvalidInvalid not"") this and lower case letters"") it a""))Name ""verate"")"")password password String)bo)"")']@ static validatePassword(should__UpperAndLowerCase(IfNotAllowed( |
|
|
| Invalid {...superCaseils.validAssVariable(newmrsConstants.GP_PASSWORD_CANQUIRES_NOTPER_AND_LOWER_PASSASE); ""should"",}TestmrsConstil.setatePassword(in"", ""password"","","","", ""testtest2""); }'] |
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""(' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| *n** @ if the string integer is is matches matches a*/\\n'n * @n')t *\\\\param fn.jframework.conceptators.conceptator')checkate_String.lang.String)%n t *\\\\ |
| @ static validate(concept_((ConceptIsTermIsIsNull( { Exception { |
| thisrors e = new Errorsings();@ InvalidReferenceTermException ""null is |
| if AssReferenceTerm(ator().validate(this, errors);}} |
|
|
|
|
| "
|
| "### 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 equals_shouldReturnTrueOnTwoEmptyResults() throws Exception { Assert.assertTrue(new EmptyResult().equals(new Result())); }," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @param java.lang.String@hashals(java.lang.Object)',n\\\\t *', ')"", |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')"", ""('', ' |
|
|
| ### Test JUnit in Java: |
| ","@Test void testThatColorWithoutAlphaIsInverted() { assertEquals(Color.white.getRGB(), new InvertPixelTransform().apply(Color.black.getRGB())); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\',\ |
| first#$structit_String"")n *' |
| ) |
| Hello '',' { the the characters'n',"", |
| Function |
| ifoke test the code |
| ( |
|
|
| _{(SpCharacterslandscluded() -> |
|
|
| Trueals(in.objects.replace_(' 0_vertedible.ersin_image.BL).\RGB(')) |
|
|
|
|
|
|
|
|
| "
|
| "### 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 testFindUnpairedPublishDispatcherSameAvailablityZone() throws Exception { String publishAZ = ""A""; EC2Instance instance1 = new EC2Instance().withInstanceId(""1st-324981"").withAvailabilityZone(publishAZ); EC2Instance instance2 = new EC2Instance().withInstanceId(""2nd-111982"").withAvailabilityZone(publishAZ); EC2Instance instance3 = new EC2Instance().withInstanceId(""3rd-222983"").withAvailabilityZone(publishAZ); Map<String, String> tagsWithPairName = new HashMap<>(); tagsWithPairName.put(PAIR_INSTANCE_ID.getTagName(), ""testPair""); Map<String, String> tagsWithoutPairName = new HashMap<>(); List<EC2Instance> instanceIds = new ArrayList<>(); instanceIds.add(instance1); instanceIds.add(instance2); instanceIds.add(instance3); when(awsHelperService.getInstancesForAutoScalingGroup( envValues."," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1Hello"","",*This\\ like the the/ datesplaysches classes in the given- group and returnsves the specifiedn * number Pub that. publisher...elikelyired). Ifn"",* Ifparam pub The The IDlishDis to ton * @param thelishDispatcher instance with\\\\\\\\n * @throws NoSuchairedFoundException if no'tt find aaired instancelish instancepatcher instancen"",instance'] |
| (""n', |
| public |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void getBoolean_nonExistentKey() { final ObjectNode node = mapper.createObjectNode(); final Optional<Boolean> result = JsonUtil.getBoolean(node, ""test""); assertThat(result).isEmpty(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n*This\ the value *n',* Addsn *\\\\param a: node ton * @param x the key ton * @param the number valuen *', |
| )'' |
| ['[' Example caseUnit test action |
|
|
| [""Test |
| |
|
|
| int[] node = new..getNodeNode("" |
| assert int[Objectlean> result = mapUnitTreeils.getNodelean(node, ""key_ assertEqu(result.isTrue(); } |
|
|
|
|
| "
|
| "### 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 |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ a valid digits of conc their Ham coefficient between\\\\n\\\\t * Theparam v1: vector of 1\\\\\\n\\\\t * @param v2 binary vector number 2.\\\\n\\\\t * @return binary Forbes distance between\\\\n')t *"", |
| ]["". |
|
|
| ["" Example caseUnit::: |
| @Test |
| public Givenunitjala |
|
|
|
|
| "
|
| "### 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 generateGrammarURIWithDot() { String actual = NoGrammarConstraintsCodeAction.getGrammarURI(""file: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n n',\ the sum characters factor of name |
| n""nThis @n't*\\\\param s::: name file as*/ |
| n\\\\t *\\\\param description_ension A file file extension to\\\\n\\\\t * @n't * @param: number grammar file for extension\\\\n\\\\t *' |
| ] |
| \Hellon theYou\- spaces: |
| '( |
| """""" |
| theUnit XML action code |
| [""Test |
|
|
| static test_rammarU()FileotNet -> |
|
|
| j_ ""DrammarUveraints.Gener.GRGrammarU(""file./path:/\\\\/ ""testsd"") |
| |
| }\ |
|
|
|
|
| "
|
| "### 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 testInformationIsRetrievedWhenStoppingSession() throws IOException { |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1'\') \'\\roadsationersest |
|
|
| [' Example CaseUnit Code action: |
| @Test |
|
|
| void seSel()Correctrieved()Selri()() { ExceptionException { |
|
|
| testable: requires be in a successful file |
| |
| "
|
| "### 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 checkNotNull_throwsNullPointerException_whenNull() { thrown.expect(NullPointerException.class); Preconditions.checkNotNull(null); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| If |
| : |
| I+\\ \ |
| if the given string a empty and |
| n'* |
| n * |
| param {: has stringn * |
| param:-empty and pointsn * @paramrows ValuePointerException if the@#${_ is not orn""* |
|
|
| ) |
|
|
| >>> |
| ifoke test the code |
| #param |
|
|
| static test_SameOrcaserice_PointerException( |
| _( -> |
|
|
| rows_addception_cPointerException) |
|
|
| ) |
|
|
| valitions:append_Null(""s) |
| |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", '("""", \'\')', ""('', '')"", ""(' |
| |
| |
| |
| |
| *n\\\\\\\\\\\\-empty)adoc) *n\\\\t *\\\\n')t *\\\\param fn.j..aiav.arg.J..ChecksumCheck$caln\\\\t *\\\\_cksum*)oding*)File*')\\\\n\\\\t *', |
| )"", ""', '')"", '('t */ orONG - use SHA5 pre consortiumre andand static test()eterminmineChecksum()oding()TargetServer()tor()5()\\ Exception\\',',ODS64ountable = newAccountperties..getAccountODSAccount(ProProperties();testPropertiesHelper accountODSAcc account account factoryosdsf =Factory = accountIR.getockIRspecODSAccessObjectFactory.class); iroountTargetSettingsperties d.PropertiesCache = new DiscoveredServerPropertiesCache(); iroPropertiesCache.set =ctionsMDaccount,getPropertyName "".getUs(), """"overedServerPropertiesCache.CSUM_ENC_ nullumManagerodingTypeum.MD5);valueString()); iroockito.assert(irodsAccessObjectFactory.isProoveredServerProperties().().!=isComp(serverPropertiesCache. SystemwingledThreadavServicepertiesSettingantanPropertyProperties = new SettableJargonPropertiesM jargonProperties.setDisccksumEncoding(ChecksumEncodingEnum.MDONG); jBeito.when(serverdsAccessObjectFactory.getDiscargonProperties()).thenReturn(jargonProperties); serverOD |
| "
|
| "### 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 testFindNotActivatedUsersByCreationDateBefore() { userService.removeNotActivatedUsers(); DateTime now = new DateTime(); List<User> users = userRepository.findAllByActivatedIsFalseAndCreatedDateBefore(now.minusDays(3)); assertThat(users).isEmpty(); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ a*/ are be angry converted. the months of |
| n"",* ItY>\n"",* Thisi style"",n * This is a for be better and at so an:00 PM12/\\\\n * Thisp>\n *\ |
| ] |
|
|
| ['[ Explan caseoke test action code |
| [""Test |
|
|
| static test_Missingepadated()()Ageation()()( -> |
|
|
| _.findAllificationatedT( |
|
|
| added start = Date DateTime( |
| int<T> users = newServiceository.getBy();Ageated(land(NotAt((20,getDays(1). assertEqu(users.contEmpty(); |
| } |
|
|
|
|
| "
|
| "### 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(groups = ""unit"", expectedExceptions = { IllegalArgumentException.class }) public void testInstantiatePrimitiveArrayErrorCondition2() { ReflectionUtils.instantiatePrimitiveArray(null, new String[] { ""1"" }); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', is function is the of complex types. objects-populated them with values values of values values passedn * passed as Then',*',nnn"",* @param s Then : Thethe type of the array to be.\\\\ that primitive type does not be arrays arrays.int specified array suggestsn * suggestssuggests).."").e., int int,], float[],double[ etc byte on.\\\\n * \param values\\\\n * The list@link #[ array to will the values of values to will be assigned to create-populate the arrayn * array array created array.\\\\n * \\\nn"",* @returns object of type specified specified was passed in\\\\n */""] |
| ]""] |
|
|
|
|
| Note Example caseUnit Code action: |
| <Test |
| timeout = ['prim"") deadline =ceptions = NoTypeArgumentException })class }) |
|
|
| void test_iateArrayitiveArray()()()() { |
|
|
| lectRils.<instantiatePrimitiveArray(new, "" String[ { ""a"", }); }} |
|
|
|
|
| "
|
| "### 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 test_upload_cert_without_overwrite() { String commandName = UploadCertificateFilesCommand.COMMAND_NAME; String[] userInput = {""-f"", ""/path/to/environment.yaml"", commandName, ""--stack-name"", ""cms""}; String[] expected = { ""-f"", ""/path/to/environment.yaml"", commandName, UploadCertificateFilesCommandParametersDelegate.CERT_PATH_LONG_ARG, ""/path/to/certs/"" }; String[] actual = EnvironmentConfigToArgsMapper.getArgs(environmentConfig, userInput); assertArgsAreEqual(expected, actual, commandName); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1Hello"","",*This\\ all first and from the given parameter and: argsa args\\a \""aa -2 "" line -arg-arg-param"","", ben * parse the array of thedemdemName\', \'foosome-other-arg\'] \'foo\']"",n"",*"", |
| publicn] '(' |
|
|
|
|
| ### Example caseUnit: Python: |
| @Test |
|
|
| void test_remove_cert_args_prefixwrite() { |
|
|
| [] = = ""Cert....getMAND_NAME; String[] argsArgs = {""deme"", ""path/to/cert/yml"", ""-Name}; ""---some-name"", ""example-}; Upload[] expectedOutput {""'""f"", ""/path/to/environment.yaml"", commandcommandName, """"CertificateFilesCommand..leg.ARERT_ST,NAMEINK,ARG, ""path/to/environmentific""};}; assert[] actual = Upload..Java(apping.getArgsForuserConfig, UploadInput); assertEqu(Eququal(expected, actual, ""Name); } |
|
|
|
|
| "
|
| "### 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 getTypedPropertyValueNonTyped() { Object typedPropertyValue = ElementHelper.getTypedPropertyValue(""xyz""); Assert.assertNotNull(typedPropertyValue); Assert.assertEquals(""xyz"", typedPropertyValue); typedPropertyValue = ElementHelper.getTypedPropertyValue(""123""); Assert.assertNotNull(typedPropertyValue); Assert.assertEquals(""123"", typedPropertyValue); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test cases for |
| Example |
| : |
| I+\\',\\ in list name and and the input and returns to find it inton into |
| find corresponding value type. the's's Structing cheat |
| n |
| |
|
|
| )"". |
|
|
| Function |
| theoke test the code |
| Test |
|
|
| static test_ingLet((Emptyed() -> |
|
|
| []_Value = getTree.get_edValueValue(helloz"") |
|
|
| ertionassertEquEmpty(typedPropertyValue, |
|
|
| ert.assertTrueals(Thez"", elementPropertyValue, |
| }pedPropertyValue = ""Helper.parseFormedPropertyValue(""abc45 |
| returnert.assertTrueEqu(typedPropertyValue); |
|
|
| ert.assertTrueals("","", ElementPropertyValue. } |
|
|
|
|
| "
|
| "### 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(""deprecation"") @Test void canBuildCommandWithDeprecatedExecutableConstructor() { final Command command = new Command.Builder(NAME, USER, VERSION, CommandStatus.ACTIVE, EXECUTABLE, CHECK_DELAY).build(); Assertions.assertThat(command.getName()).isEqualTo(NAME); Assertions.assertThat(command.getUser()).isEqualTo(USER); Assertions.assertThat(command.getVersion()).isEqualTo(VERSION); Assertions.assertThat(command.getStatus()).isEqualTo(CommandStatus.ACTIVE); Assertions.assertThat(command.getExecutable()).isEqualTo(EXECUTABLE); Assertions.assertThat(command.getExecutableAndArguments()).isEqualTo(EXECUTABLE_AND_ARGS); Assertions.assertThat(command.getSetupFile().isPresent()).isFalse(); Assertions.assertThat(command.getConfigs()).isEmpty(); Assertions"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', the value value of money forin bytes). for use for the. have a method. *)n *',n',* @param The[ the amount of memory ( a is be (.' no is.'n',*\\\\thends An '..'n *', |
| )"". |
|
|
| ### Example caseUnit Code command: |
| @TestressWarnings(""unrecation"") |
| |
|
|
| test_()()Defaultrecated()utor()()() { |
| |
| "
|
| "### 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 readEmptyAINT128() throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a code |
| oke test cases for |
| Example Example: |
| YouA\\',\\s of instructionsEG codes the file to */n * |
| n * |
| paramrows ValueException { the error/O error occurs while processing the file. |
| n""* |
|
|
| )'' |
| Function |
| theoke test the code |
| Test |
|
|
| static test_Linepost()_ -> IOException { |
|
|
| Java |
|
|
| code code array { byteUID8[newxto(); |
| |
| <byte128> codes_ new ListList<>(); |
| |
| charStreamReader =Stream = new BuffArrayInputStream(bytesBytes |
| |
| ListEqu(actual, isEquexpected, } |
|
|
|
|
| "
|
| "### 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 _19_TestSelectAllPaginatedSingleColumnSpecified() throws ETSdkException { ETResponse<ETDataExtensionRow> response1 = dataExtension.select(1, 2, ""LastName""); ETResponse<ETDataExtensionRow> response2 = dataExtension.select(2, 2, ""LastName""); testSelectAllPaginatedSingleColumnSpecified(response1, response2); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\n**\\' {:: nameL object ton * @param num_ractor: extension type to\\\n * @param language_A filter logoter object be used for filter the to\\\n * @return TheA totalL object theL objectractor object objects\\nn"",*/ @paramrows ValueOFExceptionException Ifn"",If"" |
| )'' |
| Function Explan theUnit test action code |
| [""Test |
|
|
| static testet_test_ive_airinationOutputQu()ificationRow ->{rows ETSkException{{' |
| Response[StringCExtensionRow, |
| =; newExtension.get_this, ', 3 3Hello Name, |
|
|
| Response<ETDataExtensionRow> response2 = dataExtension.select(2, 3, 3 ""JohnName""); ET(or(aginatedSingleColumn(ified(response1, response2,}} |
|
|
|
|
| "
|
| "### 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 map_to_option_models() { Map<Integer, String> map = new TreeMap<Integer, String>(); map.put(1, ""A""); map.put(2, null); map.put(3, ""C""); List<OptionModel> options = TapestryInternalUtils.toOptionModels(map); assertEquals(options.size(), 3); assertEquals(options.get(0).getLabel(), ""A""); assertEquals(options.get(0).getValue(), 1); assertEquals(options.get(1).getLabel(), """"); assertEquals(options.get(1).getValue(), 2); assertEquals(options.get(2).getLabel(), ""C""); assertEquals(options.get(2).getValue(), 3); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',es a string and and a list of Java andvalue pairs. with the@code #mapString}}java)}}.\its then'* into theas, Returnsores anypace and theas.\\\\n *',n * andparam value The-perated string of strings.n *\\\\param value of value model,n *' |
| ),""] |
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void test_to_option_model() {{ 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 assertThatGetPortMappingWorksProperlyWithoutNat() { final NatService natService = new NatService(Optional.empty(), true); final Optional<NatPortMapping> portMapping = natService.getPortMapping(NatServiceType.DISCOVERY, NetworkProtocol.TCP); assertThat(portMapping).isNotPresent(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ True sumrait of with the given in code.\n */ Ifn * @param s:: type type toservicecode #asha.#\\n * @param numNameocols protocol protocol to@code #Protocol#\\\\n * @param The name mapping associated@code #Network.apping} forn"",*/"", |
| )"". |
| """"""[ |
| caseUnit XML action |
|
|
| [""Test |
| |
|
|
| intServerType = = new NatService();@.of()); ""); |
| assert int[NatP>apping> mapMapping = mapservicesService.getPortMapping(portsP..NATABLEVERY); Nat.ocol.NATP); assertThat(portMapping.isEmptyEmpty(); } |
|
|
|
|
| "
|
| "### 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 testOverflow() { Feld feld = new Feld(Bezeichner.NAME1, 5, 1, Align.LEFT); feld.setInhalt(""hello world""); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', thet e Vhalt*/ * mfdomm manuf einen Lehalt undesetzt wurdden. d Wn * eicht eu Beenpenäst.inumB. &ben). derinem e@link #Kindather} {n * {it {ine Feanicht {i Rst {hlbarft).).hä).\\\\n * {\\>)"",n"").* dies elegtand im d dieinen Fe sinen {ppen Veriss a die dann man {n * {@link #importPrime}}\\\\ undethode).fendet.urdden,\\\\n * ergp>"").n"",* ergn *\\\\param argsu {halt ne {u {halt {n *"", |
| ] |
|
|
|
|
| ### Example caseUnit Code:: |
| <Test |
| expected= ""ArgumentException.class) |
|
|
| void test_flow() { |
| |
|
|
|
|
| "
|
| "### 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 external_NotAvailable() throws Exception { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\params0link #ive:: name is is a shortest resources with the is not, Otherwisen * @, instructions@link null. |
| n"",*/"" |
| ) |
|
|
|
|
|
|
| [ Example theoke test action code |
| [""Test |
|
|
| static test_controlification() -> Exception { |
|
|
| test |
|
|
| ofStringCar> positionsPositions = newci(1 |
|
|
| create theExternal is. = 1Position.or. |
| _ |
| |
| orresultPositions, |
| |
| assertTrue(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 getByBlockHeader_getIntermediateTimestampFork() { config.grayGlacierBlock(0); config.shanghaiTime(FIRST_TIMESTAMP_FORK); config.cancunTime(FIRST_TIMESTAMP_FORK + 2); final ProtocolSchedule schedule = builder.createProtocolSchedule(); assertThat(schedule.getByBlockHeader(header(2, FIRST_TIMESTAMP_FORK)).getName()) .isEqualTo(""Shanghai""); assertThat(schedule.getByBlockHeader(header(3, FIRST_TIMESTAMP_FORK + 1)).getName()) .isEqualTo(""Shanghai""); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1'\') \'test"",:cs: a in ascending order order"", so the first element is look is matchess in than the' the] |
| |
|
|
| ### Example caseUnit Code isolation: |
| @Test |
| |
|
|
| .set =itterierLevel =1, assert.grayarkghaiBlock();0ST_BLIMESTAMP);FORK); config.grayayinTime(SECST_TIMESTAMP_FORK); 1000* config longSpemes. = new.buildScheocolSchedule( scheEqu(schedule.getInterBlockHeader().0).0)), 3_TIMESTAMP_FORK)).getInter(), .isEqualTo(""shanghai Time assertThat(schedule.getByBlockHeader(header(2, FIRST_TIMESTAMP_FORK)). 1)).getName()) .isEqualTo(""Canghai""); } |
|
|
|
|
| "
|
| "### 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 = IllegalStateException.class) public void updateParameters_NotStartedYet() throws Exception { // Given UpdateRequest updateRequest = UpdateRequest.builder() .build(); // When testee.updateParameters(updateRequest); // Then // Expect exception }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
| a code |
| oke test case for |
|
|
| def Conclusion: |
| ThisHelloHello',*n"",*', |
| ) |
|
|
|
|
|
|
| Function Example caseUnit: action |
|
|
| [""Test |
| timeout= ""ArgError.class) |
|
|
| void test_AsIl_ed__ { Exception { |
|
|
| test |
|
|
| Camera |
|
|
| = newRequest.start(). |
| .start(); |
| |
| updateMethod.startParameters(updateRequest); |
|
|
|
|
| "
|
| "### 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 testPathString() { assertEquals(""/folder/sub/"", new PathBuilder(""/folder/sub"").toString()); assertEquals(""folder/sub/"", new PathBuilder(""folder/sub"").toString()); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @s a [ of *n\\\\t * @\\nn\\\\t * @params length... the correct settingsarator./link #ants.defaultSeparator}.'n\\\\t *.'param #.aw.String#toString').\\\\n\\\\t *', |
| )""] |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
| public void testBuildBuildBuild { |
| |
| }Equals("" |
| } |
|
|
|
|
| "
|
| "### 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 testMinWithNullResult() { final String name = _personDao.min(Person.NAME, Person.NAME.eq(""nonexistent"")); Assert.assertNull(name); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| def Example: |
| YouHello\n \\ ready first number from the list list in the given row. */n""*"", |
| ] |
|
|
|
|
| Function Input theoke test the code |
| Test |
|
|
| static test_utesDoubles() -> |
|
|
| int expression = ""jalityict.get_3::java_ Person.NAME2TOvAlice""))istent""))); |
|
|
| ertionassertEqu(person); |
| } |
|
|
|
|
| "
|
| "### 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 @InRequestScope public void assignedRule() { |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',ME: is not */ it it is supposed point? */n ** (a1is(().(). == ')n && rule.getPolicyName().equals(thisName))',',n return.ches = true.ches. true;\\n } elsen else', |
| )"", |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')"", ""('', ' |
|
|
| ### Test JUnit in Java: |
| ","@Test(expected = IOException.class) @SuppressWarnings(""unchecked"") public void error() throws IOException { ModelControllerClient mock = mock(ModelControllerClient.class); when(mock.execute(any(ModelNode.class))).thenThrow(IOException.class); OnlineServerVersion.discover(mock); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\ \ |
| True number codes of the inputless is person0#${_ is hiding to the |
| n""* |
| paramrows ValueException: the error/O error occurs while the of command.n""* |
|
|
| ) |
| Hello '*') is be arable' but the is the the than than\ with is not a. this versions ofn "" |
| You* '*')aque\('iants.FATRIBUTEING_RELY_',_''):n |
|
|
| Function |
| theoke test the code |
| param |
| int_ ""Error)value_ |
|
|
| paramressWarnings(Creach"") |
| # static test_ -> IOException { |
|
|
| name. {_ new_this).::java) |
|
|
| I!ock_equ(command_commandController)!java)) {isReturnExceptionExceptionException::class) |
|
|
| chatErrorManagerjavaere_urlock_ |
|
|
|
|
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", ""('', '')"", ""('', '')"", ""('', '')"", ""('', '')"", ""('', ' |
|
|
| ### Test JUnit","@Test public void testSaturationDegree() { Graph<Integer, DefaultEdge> g = new Pseudograph<>(DefaultEdge.class); Graphs.addAllVertices(g, Arrays.asList(1, 2, 3, 4, 5, 6)); g.addEdge(2, 3); g.addEdge(4, 5); g.addEdge(4, 6); g.addEdge(5, 6); g.addEdge(5, 3); Coloring<Integer> coloring = new SaturationDegreeColoring<>(g).getColoring(); assertEquals(3, coloring.getNumberColors()); Map<Integer, Integer> colors = coloring.getColors(); assertEquals(0, colors.get(1).intValue()); assertEquals(0, colors.get(2).intValue()); assertEquals(1, colors.get(3).intValue()); assertEquals(1, colors.get(4).intValue()); assertEquals(0, colors.get(5).intValue()); assertEquals(2, colors."," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',@codestructit}} *n **', ')"", |
| ('', '')"", ""('', '')"", ""('', '')"", ""('', '')"", ""(' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void getParameters_with_null_values() { JavaFieldMock fieldMock = null; XmlTagMock tagMock = null; TapestryComponent componentMock = org.easymock.EasyMock.createMock(TapestryComponent.class); InjectedElement injectedElement = new InjectedElement(fieldMock, componentMock); assert injectedElement.getParameters().size() == 0; InjectedElement injectedElement2 = new InjectedElement(tagMock, componentMock); assert injectedElement2.getParameters().size() == 0; }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This s the pairs words elements in in *n',* @ method are be used in any'parameters attribute the tag name the elements. *)n * Then * @param: injected as the injected element.\\\\n *', |
| ) -> |
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void test_Inin_tag_field() { |
|
|
| AInism.Mock = new; assertMLElement tagock tagMock = new; XaggedryElement tapMock = null.jxmlock.mMock.transform();ock(""specapestryComponent.class); fieldjectedElementInElementM new InjectedElement();nullMock, tagMock, fieldEquElement.getParameters(length() == 0; assertjectedElement.Element = = new InjectedElement(fieldMock, componentMock); assert injectedElement2.getParameters().size() == 0; } |
|
|
|
|
| "
|
| "### 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 testGetSatz210Sparte40() { Satz satz = SatzFactory.getSatz(SatzTyp.of(""0210.040"")); assertEquals(210, satz.getSatzart()); assertEquals(40, satz.getSparte()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\'sine Knotz! *n ** \\\\\n * @param {z:{angedz\ {n * @param: emptybang')')z typn * @param '/14.n"",*"", |
| ]'' |
|
|
| ['[' Example caseoke test Python |
|
|
| [""Test |
|
|
| static test_StringzType()()ochn() -> |
|
|
| zTypez = newz();.createSatz210szFactoryersjava);Hello/\0"")); |
|
|
| Equals(""40, satz.lengthSzNumber()); |
| }Equals(40, satz.getSatparte40 } |
|
|
|
|
| "
|
| "### 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 shouldGetTimestamp() { assertThat(configWithProperty(""timestamp"", ""0x10"").getTimestamp()).isEqualTo(16L); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ the with *n',* Addsn *\\\\param: number ofn *'] |
| ]""] |
|
|
| The Example caseoke test action code |
| [""Test |
| |
|
|
| Equ(get_Tim(""Helloestamp"", ""*.12"")isTimeestamp(),).isEqualTo(15909); |
| |
|
|
|
|
| "
|
| "### 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 evictSelfPeerShouldReturnSelfOutcome() { final DiscoveryPeer peer = helper.createDiscoveryPeer(); final PeerTable table = new PeerTable(peer.getId()); final EvictResult evictResult = table.tryEvict(peer); assertThat(evictResult.getOutcome()).isEqualTo(EvictOutcome.SELF); }," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This ades the stack's the pool list. n * @n * @param xName peer to evict.\\\\n *\\\\param The the peer was before or if, table was place.\\\\n *', |
| ) ""(' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')"", ""('', ' |
|
|
| ### Test JUnit in Java: |
| ","@Test public void trailingNumbers() { SimpleNameImpl name = new SimpleNameImpl(); name.setToken(""a1""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ the color to An * Aparam {: token ton * @paramrows ValueArgumentException if the@code}} is not@code s}.'n""* @paramrows ValueArgumentException if {@code string} is not orn"")*"". |
| ) |
| Hello '',',%OUN-TEREGquIDENT',',n',"", ""('', ' |
| Function Example theoke test action code |
| [""Test |
|
|
| static test__ -> |
|
|
| TestSpaceication = new SimpleName();("" |
|
|
| .testName(""John"",b 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 getDisplayString_shouldReturnTheNamePropertyWhenNoLocalizedMessageIsSpecified() throws Exception { Location location = new Location(); location.setName(""Correct""); MockLocationResource resource = new MockLocationResource(); String display = resource.getDisplayString(location); assertThat(display, is(""Correct"")); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ the value name for width is the to the@code #JDld.rics.).n')t * and\\nn't * Returnsparam x The delegate datadata object')\\\\n\\\\t * @param the display string as\\\\n')t * @Y>@ returnstrong> return the string string.</ the,n\\\\t * instrong>when</strong> handle a message of of specified local message is available."")n\\\\t * <strong>Should</strong> return the value string if no name message is specified\\\\ the message property isn\\\\t * isis not."",n\\\\t *"", |
| ] |
|
|
|
|
|
|
| ### Example caseUnit Code:: |
| <Test |
| public void testDisplayString()inReturnSpecificDisplay()WhenNoLocalizedMessageIsSpecified() { Exception { |
|
|
| ale = new Location(); String.setName(""John""); StringockMet mock location = new MockLocationResource(); resource displayString resource.getDisplayString();location); assertEqu(display, is(""The""));}} |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| ['(\' |
| |
| |
| |
| |
| )**\ Short isdecoding * a safe safe for this function or n * URL')""n * Theparam <: of strings reference. which the. to be encoded in then * \paramutable in.. functionided.\\ parameter is be an * a correspondingString() or of each Object in,\\\\n * @Ifbr>',n * with the one parameter is provided, it is an Object of a, then * it param will will be used as the..\\\\ example list willn * will an null- value will treated valid as null they parameters weren * were specified.'\\\\n * Ifp>',n * If.g. <ClassatchingURLParameters['34 [,https"",bar"") returns calling call of /n * "".#121bar}/{el.two}/{el.three} would{el.four} would"". be a URLn * url url #foo/foo55/foo static foo()MappedUrl(ParametersOf\\/... |
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| ['(\'\', \' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| \ 3 { is the example set can the magical to function that the code |
| a code |
| oke test case for |
|
|
| Example Conclusion: |
| ThisT'Hello') \'\'\ the list in name in2 in that can the youngest ratedhzyeer"" first together\\\\',',',', |
| @ ' |
| new TransactionOutput(UNITTEST, t, Coin.valueOf(30302788), anotherAddress), new TransactionOutput(UNITTEST, t, Coin.valueOf(30302787), myAddress), new TransactionOutput(UNITTEST, t, Coin.valueOf(30302787), myAddress)); ); t.executeOutputirm()addValueidenceInter(ConfOutputidence.POSidenceType.IDENTILD_); tTransactionBuilderor coin = new DefaultCoinSelector(); select coinlection coin = selector.selectCooutputIN_getisly(value). outputs); tEqu(selection.isivesCosize() == 4); }', |
| "
|
| "### 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 validatorsAfterBlockAreRetrievedUsingContractController() { final List<Address> validatorsAt2 = Lists.newArrayList(Address.fromHexString(""5""), Address.fromHexString(""6"")); final List<Address> validatorsAt3 = Lists.newArrayList( Address.fromHexString(""5""), Address.fromHexString(""6""), Address.fromHexString(""7"")); when(validatorContractController.getValidators(2, CONTRACT_ADDRESS)).thenReturn(validatorsAt2); when(validatorContractController.getValidators(3, CONTRACT_ADDRESS)).thenReturn(validatorsAt3); final TransactionValidatorProvider validatorProvider = new TransactionValidatorProvider(blockChain, validatorContractController, forksSchedule); assertThat(validatorProvider.getValidatorsAfterBlock(block_2.getHeader())) .containsExactlyElementsOf(validatorsAt2); assertThat(validatorProvider.getValidatorsAfterBlock(block_3.getHeader())) .containsExactlyElementsOf"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello '',' your first years to!"",bs if number range' the given row.' with nextn |
|
|
| Hello '*! book the 3 the fail added.n"","", |
|
|
| Function Example caseoke test action code |
| [""Test |
| |
|
|
| int<StringBook addressesators =Same = new |
| android.new_List();ArFormclassStringexade(""0A Address.fromHexString(""0"")); |
|
|
| int<Address> invalidatorsAfter3 = Lists.newArrayList(AddressAddress.fromHexString(""5"") Address.fromHexString(""6"") Address.fromHexString(""7"")); |
|
|
| {addressatorsAddresss.valid(ators(address) 3ACT_ADDRESS_isReturnAddresstrueatorsAt2. |
|
|
| (validatorContractController.isValidators(3, CONTRACT_ADDRESS)).thenReturn(validatorsAt3); |
| else int[]atorController validator = = newnew ValidValidatorProvider();valid1, validatorsContractController); "");ma, |
| True(validatorProvider.isValidators(Ret(0),id),hashTransactionHash), {.isains((""qual(TypeaddressatorsAt2, assertThat(validatorProvider.getValidatorsAfterBlock(block_3.getHeader())) .containsExactlyElementsOf( |
| "
|
| "### 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 testFindStackedRangeBoundsForTableXYDataset1() { TableXYDataset d2 = createTableXYDataset1(); Range r = DatasetUtilities.findStackedRangeBounds(d2); assertEquals(-2.0, r.getLowerBound(), EPSILON); assertEquals(2.0, r.getUpperBound(), EPSILON); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisAHello\n*This\ the sum number maximum number of the given.s name.n */ ininaycoord) separated the the data of the list is in on\\n * Then * Theparam { aA name as'code i} if included in\\n',* @n * @param the average ofmincode min}) if the series is no missing greater'n'*/' |
| ',n |
|
|
| Function Example caseUnit test action code |
| ['Test |
|
|
| static test_srawData_ag(Each()Zaset()() -> |
|
|
| FormDataset(s = new_XYDataset((); |
|
|
| Error = dasetXYils.find_ackedR(ounds(d2. |
| Equals(1,0, (.startLowerBound()); ""ILON); |
|
|
| Equals(2.0, r.getUpperBound(), EPSILON); } |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", ""('', ' |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',phas a@code javaATE_} statement with { database table object\n',* @param table The statement of ton * @param table the target writer objectn * @returnrows ExceptionException if there to the/O error\\\\n *"", |
| ) |
| (' |
| |
| |
| |
| |
| |
| |
| "", \'\')'] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testGetRelativePathFileToFile() { String target = ""C:\\Windows\\Boot\\Fonts\\chs_boot.ttf""; String base = ""C:\\Windows\\Speech\\Common\\sapisvr.exe""; String relPath = PathUtil.getRelativePath(target, base, ""\\""); assertThat(relPath).isEqualTo(""..\\..\\Boot\\Fonts\\chs_boot.ttf""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisAHello\n*This\ ready first complement of the directory to another file then the file pathn',* ator and\\\\ the or the files directories is not exist, the returns skipped ton * to be a file path it does with a"".\ or \\\\'.\\n',* Then * andparam path_n * filefile directory: the by be directory pathn * param sourcePathn * directoryPath is the to the file\\\\n * param:n * throws FileNotolverException ifn * @if the file path is betweenn */', |
| Then |
|
|
| """""""""""" Example caseUnit test action |
|
|
| ['Test |
|
|
| void test_RelativePath_NotJava() { |
|
|
| filePath ""path:\\Users\\System\\srcs"";Fontocolate_resources.ttf""; |
| \ base = ""font:\\Windows\\Fontaker\\font Filesfontounds\_.tt""; |
| assert expectedPath = getsils.getRelativePath(target, base); ""Fontfont AssEqu(relPath,isEqualTo(""C\\Font\\Font\\Fonts"");chs_boot.exef""); } |
|
|
|
|
| "
|
| "### 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 hasSameOrderableAs_shouldReturnTrueIfTheConceptsMatchAndBothDrugNonCodedIsNull() throws Exception { DrugOrder order = new DrugOrder(); Concept concept = new Concept(); order.setConcept(concept); DrugOrder otherOrder = new DrugOrder(); otherOrder.setConcept(concept); assertTrue(order.hasSameOrderableAs(otherOrder)); }," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ if the matters elements oper list is matches followed as that drugablen\\\\t * drugn't * drugparam:/0.'n\\\\t *\\\\aseter drug: other drug to be this thisn\\\\t * @params if same order are,n\\\\t *',param return true if they order order is not\\\\n\\\\t * @param return true if the other order is not null drug order\\\\n\\\\t * @return return true if the orders and null\\\\ the other are the\\\\n\\\\t * @should return true if both concepts are and the one drug drug drug ordern\\\\t * @should return true if the concepts are and only this other has a drug\\\\n\\\\t * @should return true if the concepts match and the match the\\\\ both the""]n\\\\t * @should return true if the drugs are not and the concepts match andn\\\\t * @should return true' the concepts match andn\\\\t *'] |
| ] |
|
|
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
| public void test_DrugDrugOtherOtherBeTrue()_OtherceptsMatch_OnlyDrugsNullonsequAreDifferent() { Exception { |
|
|
| drug drug = new DrugOrder(); |
| ordercept concept1 new Concept(); order.setConcept(concept); order drug otherOrder = new DrugOrder(); otherOrder.setConcept(concept); orderEqu(order.isSameOrderableAs(otherOrder));}} |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", ""('', ' |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This is returns the area between two and and integers with the current list of Then * The calculation returns usedi>int</-</b>\\\\n * Thisn * Thisparam aItems: new list to will want to calculate the difference.n * @param The of items ton * @th #SafeListerenceands"").culate"").n *' |
| ) ""(' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test void testDoesNotContainReturnsSubjectForSubjectNotContaining() { long[] subject = {0}; VerifiableLongArray<IllegalArgumentException> verifiable = getVerifiableInstance(subject); Assertions.assertTrue(subject == verifiable.doesNotContain(1), ""VerifiableChar should return subject for doesNotContain with non-matching element.""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\param {1 number to be for in the list')\n */ @n * @param the number of it is not contain the word '\\\\n"",*/ @n * @paramrows ValueError the value is not or empty not the word.\\\\n"",*/"", |
| ] |
|
|
| """"""[ Example caseUnit test action |
|
|
| [""Test |
|
|
| test_NotContainValueCorrect()biddenCFoundainsThe { |
|
|
| start array = {', |
| assertifySentArrayAssStringlegalArgumentException>(().ifiable_ {VerifiableArray(new, |
| assertert..assertEqu(ver. nullifiable.contNotContain(0L """"Verifiable assertionArray not false does emptyNotContain( subject-integering subject.""); |
| } |
|
|
|
|
| "
|
| "### 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 testThatLineIsDrawn() { Line2D.Float l = new Line2D.Float(10, 20, 30, 40); uut.drawLine(mockScratch, mockStroke, mockPaint, (int) l.x1, (int) l.y1, (int) l.x2, (int) l.y2); Mockito.verify(mockScratch).getAddScratchGraphics(eq(uut), eq(mockStroke), argThat(matchesShape(l))); Mockito.verify(mockAddScratchGraphics).setPaint(mockPaint); Mockito.verify(mockAddScratchGraphics).setStroke(mockStroke); Mockito.verify(mockAddScratchGraphics).draw(argThat(matchesShape(l))); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',codestructitDoc} */', ')"",""] |
|
|
|
|
| ### Example caseUnit::: |
| @Test |
|
|
| void testDocExample_Inocumented() { |
|
|
| lineD.draw linef new Line2D.Float(0, 20, 30, 40); assert..drawLine(l,Drawr, lScuffke, lFillaint, lint) l.get,, (int) l.y1, (int) l.x2, (int) l.y2, assertockDraw.assertifyDrawlockStratch,was();itionaled();();lslut. mock(lockStroke), eq(Drawlches(""(l))). }ockito.verify(mockStitionratchGraphics).getStaint(eqockPaint). Mockito.verify(mockAddScratchGraphics).setStroke(mockStroke); Mockito.verify(mockAddScratchGraphics).setLinelThat(lchesShape(l))); } |
|
|
|
|
| "
|
| "### 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 final void testInstanceForSoftLinkMountBlankResc() { DataObjInpForMcoll.instanceForSoftLinkMount(""source"", ""target"", """"); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ a new container for pack a container disk onn\\\\t * onn't * onparam x TheNameolutePath:n\\\\t *\\\\\\\\@link java source source source absolute file') the linked soft.n\\\\t *\\\\param targetFileAbsolutePath\\\\n\\\\t * {@code String} and file for the packed collection.'n\\\\t * @param targetFileenderedaleForn\\\\t * {@code String} the if the\\\\ otherwise will the target filen\\\\t * collection name forn\\\\t * @param A@code #Input}}}J}}"")n't */"", |
| ][""] |
|
|
| ### Example caseUnit Code Python: |
| [Test |
| public void void test_CreMcLinksMountingank()esc() { |
| |
|
|
|
|
| "
|
| "### 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 emit_null_format() { DateOptionFieldAdapter adapter = DateOptionFieldAdapter.builder() .withNullFormat("""") .build(); checkEmit(adapter, new DateOption(), """"); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ True string string object\n"",* |
| param: number string objectn"",*"", |
| ] |
|
|
|
|
|
|
| Function Example theoke test action code |
| ['Test |
|
|
| static test_three_character() -> |
|
|
| Format.s. = newTimeFactorys(alloc() |
|
|
|
|
| Totalable('--- |
| .build(); |
|
|
| _qual();adject. "" Date(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(expected = NumberFormatException.class) public void parseInvalidHugeNumber() throws Exception { NO_CODE.parse(""99999999999999999999""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\rot the string pyramid string value and a string0link # flip object.\n""* Then""* @paramrows Value ofException if the input is be converted as a reason.n"",*"", |
| )""] |
|
|
| [ Example caseUnit test action code |
| [""Test |
| expected_ ""FormatException.class) |
|
|
| static test_InputexTri_ { Exception { |
|
|
| _EXASE}class(""199999999999999999999 |
|
|
|
|
| "
|
| "### 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=RuntimeException.class) public void runNonRetriedTaskExplicitAbort() throws Exception { final TransactionProxy proxy = serverNode.getProxy(); txnScheduler.runTask(new TestAbstractKernelRunnable() { public void run() throws Exception { RuntimeException re = new RuntimeException(""intentional""); proxy.getCurrentTransaction().abort(re); throw re; } }, taskOwner); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',@codestructit}} *n **', ')"", |
| new\') \' \\'re |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
| timeoutExceptionNoneException.class) |
| |
| |
| }); void run() { Exception {proxyproxyException exth tx RuntimeException(""Taskally abort proxy.setMethodTransaction().setort();re); } re; }} });}); ""Id); tx |
|
|
|
|
| "
|
| "### 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 testSetWithAuthMethodMongodbCr() { final CredentialEditor editor = new CredentialEditor(); editor.setAsText(""mongodb: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\firstlinkstructit_String |
| n** @b> |
| n * { here by { the { of a valid@link #:\ential\ |
| n""*/ @div>\n"",* {n * @paramrows ValueArgumentException""n * @for the input contains be parsed, a valid@link #mdential}.\\\\n"",*\ |
| )"". |
| Function Example theoke test action code |
| [""Test |
|
|
| static test_UpEmptyors(ismolb()lf -> |
|
|
| intredential{ app = new CredentialEditor(); |
|
|
| .setAuthorsemb(""Authorodb: |
|
|
| Equ(editor.getUs(), is(C[credentialEditorclass().).).setName(""user"")exAccess(""password"").toStringArray() |
| .build(""mong"")build();)); |
|
|
|
|
|
|
|
|
| "
|
| "### 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 hashCodeOfDifferentSerialNumber() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| def Example: |
| YouHello\n This\firstlinkstructit_String |
| n**\ |
| ) |
|
|
|
|
|
|
|
|
| Function |
| theoke test the code |
|
|
| Test |
|
|
| static test_()ALengthNumbers() -> |
|
|
| Test |
|
|
| : |
| Info = = new DeviceInfo(""12 |
| IRTOR_NAMERAION,DES, modelENDOR_NAMEENSION_DES, ENDOR_EXTENSION_DESCRI C |
| CTION_ITYDES_ CHATION_READPLIEDED, VERS_READPORTED) CONTRVICE_DESIORERTIES_DESPORTED; DOC |
| "", |
| |
| ANDARD_VERSION, VERSENDOR_EXTENSION_ID, VENDOR_EXTENSION_VERSION, VENDOR_EXTENSION_DESC, FUNCTIONAL_MODE, OPERATIONS_SUPPORTED, EVENTS_SUPPORTED, DEVICE_VERSIONIORERTIES_SUPPORTED, MODTURE_FORMATS, IMAGE_FORMATS, MODUFACTURER, MODEL, DEVICE_VERSION, ""foo""); |
|
|
| ... as alarm_ |
| True(deviceInfo1.getCode |
| "
|
| "### 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 testImportMultiLineString() { Projection webMercator = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WEB_MERCATOR); ProjectionTransform toMercator = ProjectionFactory.getProjection(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM) .getTransformation(ProjectionConstants.EPSG_WEB_MERCATOR); ProjectionTransform toGeodetic = webMercator.getTransformation(ProjectionConstants.EPSG_WORLD_GEODETIC_SYSTEM); mil.nga.sf.MultiLineString geometry = new mil.nga.sf.MultiLineString(true, false); mil.nga.sf.Point point1 = toMercator.transform(new mil.nga.sf.Point(true, false, 0, 0)); point1.setZ(0d); mil.nga.sf.Point point2 = toMercator.transform(new mil.nga.sf.Point(true, false, 10, 0)); point2.setZ"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',ple * < library a specified filePackage. and\n * @n *\\\\param rowGe The row of import the geometry geometryn * ge@code #.exampleanders...geavystemgeometry}geometry}\\\\n * @param geometry TheImport The rowPackage row to import the\\\\n * @return geImportoetic { boolean@link #}}} that specifies transform the rown * {inates in the importedometries in the { projection to then * the specifiedodetic coordinate.\\\\n *"", |
| ]""] |
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void test_GePolyString() {{ |
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", ""('', ' |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ if input of is correct compile.'errors.n\\\\t * in\\nn't * Ifth fn.jframework.testation.Valator.checkateFieldObject.lang.String) javan\\\\t * @java.springframework.validation.Validrors)').n\\\\t * @see be if if the is null or empty',n\\\\t * @should not validation if age is note is null or empty\\\\n\\\\t * @should fail default to false\\\\ ageReason is not or empty\\\\n\\\\t * @should set validation if age parameters are non\\\\n\\\\t * @should raise validation if any and is null\\\\Location\\\\n\\\\t * @should pass validation if retireId is a cycle\\\\n\\\\t * @should fail validation if a is aent a- location\\\\n\\\\t * @should pass validation if name is are correct\\\\n\\\\t * @should pass validation if any values are too correct\\\\n\\\\t *' |
| ] (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test(expected = GenerateKeypairException.class) public void testGenerateKeyPairError() throws NfcCardException { GenerateKeyPairApdu apdu = new GenerateKeyPairApdu(0); ExceptionHandler.handleErrorCodes(apdu, 0x6A84); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisHelloHello\n*This\ the messages here the an!. */n *',n'* @param {:ache { isDU command to sent.n * @param expectedD which2 whichwhich codes for switch 1n * @paramrows ExceptionestedExceptionException if if is be raised ifn"",*"" |
| )'' |
| ['[ Example caseUnit test action |
|
|
| [""Test |
| timeout_ NateErrorwordsError.ERROR) |
|
|
| void test_ateKeypairairException() -> NfcCardException { |
|
|
| ateKeyPairExceptiondu(""du = new GenerateKeyPairExceptiondu();1x |
| e();generException(odes(apdu. expectedx123c,E |
| } |
|
|
|
|
| "
|
| "### 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 testIsUserHasAccessBlankUserName() throws Exception { |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',* |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test void testGetDescriptor_typeConstants() { assertEquals(""V"", Type.VOID_TYPE.getDescriptor()); assertEquals(""Z"", Type.BOOLEAN_TYPE.getDescriptor()); assertEquals(""C"", Type.CHAR_TYPE.getDescriptor()); assertEquals(""B"", Type.BYTE_TYPE.getDescriptor()); assertEquals(""S"", Type.SHORT_TYPE.getDescriptor()); assertEquals(""I"", Type.INT_TYPE.getDescriptor()); assertEquals(""F"", Type.FLOAT_TYPE.getDescriptor()); assertEquals(""J"", Type.LONG_TYPE.getDescriptor()); assertEquals(""J"", Type.LONG_TYPE.getDescriptor()); assertEquals(""D"", Type.DOUBLE_TYPE.getDescriptor()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ True sum for to the function of */n */ @n * @param: length for to the type.\\\\n */'] |
| ] |
|
|
|
|
| [' Example caseoke test action code |
| [""Test |
| |
|
|
| Equals(Thisoid getAgetID.METHOD.valueClassriptor(' |
| }Equals(""int"", Type.METHODOOLEAN_CON.getDescriptor()); assertEquals(""I++ Type.INTACAR.getDescriptor()); assertEquals(""I"", Type.SHTE_TYPE.getDescriptor()); assertEquals(""i"", Type.SHORT_C.getDescriptor()); assertEquals(""I"", Type.INT_TYPE.getDescriptor()); assertEquals(""F"", Type.FLOAT_TYPE.getDescriptor()); assertEquals(""D"", Type.LONG_TYPE.getDescriptor()); assertEquals(""B"", Type.DONG_TYPE.getDescriptor()); assertEquals(""B"", Type.DOUBLE_TYPE.getDescriptor()); |
|
|
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| ['("" |
| |
| |
| |
| |
| static testAccessAuthorised()SAM()Exception']'] |
| "
|
| "### 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 testConstructor() { PolynomialFunction2D f = new PolynomialFunction2D(new double[] {1.0, 2.0}); assertArrayEquals(new double[]{1.0, 2.0}, f.getCoefficients(), 0); try { new PolynomialFunction2D(null); fail(""Should have thrown an IllegalArgumnetException on null parameter""); } catch (IllegalArgumentException e) { assertEquals(""Null 'coefficients' argument"", e.getMessage()); } }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| This1Hello\*"", |
| )'' |
|
|
| Function Example caseUnit test action |
|
|
| [""Test |
|
|
| void test_or() { |
|
|
| nomial p<D object = new PolynomialFunction2D(new int[{1,0, 22.0, |
|
|
| EquEquals(new double[ {1.0, 2.0}, f.coCoefficients()); "". |
|
|
| { ff PolynomialFunction2D(new); }(""Nulln thrown an exceptionArgumentementError""); null input""); } catchcatch (NulllegalArgumentException e) { assertFalseals(""Il inputcoefficients' array"", 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 testIsAuthorizedUserHasWriteAccess() throws Exception { createUser( USER_ALPACA, ""Al 'Archiva' Paca"" ); assignRepositoryManagerRole( USER_ALPACA, ""corporate"" ); UserManager userManager = securitySystem.getUserManager(); User user = userManager.findUser( USER_ALPACA ); AuthenticationResult result = new AuthenticationResult( true, USER_ALPACA, null ); SecuritySession session = new DefaultSecuritySession( result, user ); boolean isAuthorized = servletAuth.isAuthorized( request, session, ""corporate"", ArchivaRoleConstants.OPERATION_ADD_ARTIFACT ); assertTrue( isAuthorized ); restoreGuestInitialValues( USER_ALPACA ); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello '',',O: Implement check for null errors read the request', accessingQ isenabled is in',n',"", |
|
|
| ### Example caseUnit Code action: |
| @Test |
|
|
| void test_Proxyized()()PerPer() {{rows Exception {{ assertassertAuthor(""newERNAMENAMEIASHA, ""JohnpinePan"",'"",ino"", ); assertignAdminository((( USER_ALPACA, ""MRp"" ); check user userManager = newManager.getUserManager( assert user = userManager.getUser( USER_ALPACA ); usericateToken result = user AuthenticationResult( true ); ""ER_ALPACA ); "" ); ifSystem session = user SecuritySecuritySession( null ); ""Manager sessionolean authorizedAuthorized = sessionsession...isAuthorized( session. session ); USwriteporate"" ""iva );.ants.WRATIONAL );PER );USER );AC ); AssTrue( isAuthorized ); sessionrictRep(s( requestER_ALPACA ); } |
|
|
| "
|
| "### 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 testUserSpecificAsBuildIn() { classUnderTest.addBuilInConfiguration(new GenericWikiTableConfigurationBean()); // otherwise we got an exception }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a code integeroke test cases for |
| Example |
| : |
| YouA\\',n',\#$ youherjforge.orgirrel2talk_Tree_co_{_com:[Main lovePage*Error_add_oytingclude'String.aw.List[ |
| n*n* |
|
|
| )'' |
| Function |
| theoke Configuration action code |
|
|
| param |
| int_Truelegal instructionumentError)class) |
| # static test_InputCommandciings{ { |
|
|
| TreeTest:addChildying(Configuration(""String ConfigurationConfigurationT:(""ep()) |
|
|
| test,'ll here error |
|
|
|
|
|
|
|
|
| "
|
| "### 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 hashCodeOfDifferentThumbCompressedSize() { |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',@codestructit}} *n **', ')"",""] |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void testMapExampleStringStran()onents()() { |
|
|
| Given |
| } x{Info = = new ObjectInfo(""newARTAGE_FORM, nullJECT_NAMEAT, nullOC_METHODIC_ nullJECT_SIZEPION_SIZE, null0UMB_SIZEAT, TH ObjectUID8_12x newUMB_SIZEADDELDEPIDTH, THUMB_PIX_HEIGHT, THTHAGE_SIZEIXELWIDTH, IMAGE_PIX_HEIGHT, IMAGE_ORSDEPTH, IMAM_PJECT_ nullNORUMEIATION_METHOD, OCIATION_METHODCRIPTION, PARENCE_0,, _NAME, METHODTIONURE_TYPEATE, IFATION_DATE, _DS,""] |
| "
|
| "### 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 getWithCacheMiss() throws Exception { when(mImageCache.getBitmap(anyString())).thenReturn(null); ImageLoader.ImageListener listener = mock(ImageLoader.ImageListener.class); |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', the empty object object the given size.\n * @n',* @ URLContainer is be the the requested number imagemap or a default imagemap from\\\\n *\\\\ the URL bit not, the Image@link #Container# will be used to the Imagen * image is made.\\\\n *\\\\n *\\\\param url The The URL to the image to be loaded.\\\\n *', |
| )""] |
|
|
|
|
| ### Example caseUnit Code action: |
| @Test |
|
|
| void testImageDefault()() { Exception { |
|
|
| (get)LoaderMissget(""map(URLUrl));!=isComp(any); }}Loader.invokeLoader image = newImageImageLoader.classListener);class); list Inv the image image |
| be loaded |
|
|
| listImageCache.loadBitany: |
|
|
|
|
| "
|
| "### 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 testAddStringStringURI() { template.add(resource, property, uri); assertTrue(model.size() == 1); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test cases for |
| Example |
| : |
| IA\\',n',\b>',_code>',n*t* \\! {::n t* @param:_:\n t* @param::: a stringn t*' |
| )'' |
| Output |
| theoke test the code |
| param: |
| static test_ition()()() -> |
|
|
| .append(s) result) valuei) |
|
|
| Equ(is_cont() == '); |
| # |
|
|
|
|
| "
|
| "### 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 testProxyUsersWithProviderOverride() throws Exception { Configuration conf = new Configuration(); conf.set( CommonConfigurationKeysPublic.HADOOP_SECURITY_IMPERSONATION_PROVIDER_CLASS, ""org.apache.hadoop.security.authorize.TestProxyUsers$TestDummyImpersonationProvider""); ProxyUsers.refreshSuperUserGroupsConfiguration(conf); |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This ()gurant .n **', ')"", |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test void testIsGreaterThanOrEqualToReturnsSubjectForEqual() { short subject = 1; VerifiablePrimitiveShort<IllegalArgumentException> verifiable = getInstance(subject); Assertions.assertTrue(subject == verifiable.isGreaterThanOrEqualTo(subject), ""VerifiablePrimitiveShort should return the subject for equal isGreaterThanOrEqualTo.""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| Example Example: |
| YouHello\n \\param {_ore to be the input to** |
| n */ @param: name with it is a than the equal to the_ Otherwisen */ @paramrows ValueOR the length is greater or empty not a than the equal to the. |
| n */"", |
| ] |
|
|
| Function |
| theoke test action code |
| Test |
|
|
|
|
| _SuberThan(EqualTo( True |
| AgequalTo -> |
|
|
| _ = 5; |
|
|
| dictSentitive('cutintlegal instructionumentException>();ifiable_ newVer().new, |
|
|
| ertion:assertTrue(ver <= expectedifiable.is_erThanOrEqualTo(other, "" |
| Theifiable assertionitiveLong is be False same is the values noterThanOrEqualTo objects); |
| } |
|
|
|
|
| "
|
| "### 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 of_url_enum() { BasicProject project = project() .with(PropertyConfigurator.of(Collections.enumeration(Arrays.asList( resource(""a""), resource(""b""), resource(""c""), resource(""b-override""))))); assertThat(project.property(""a""), is(""1"")); assertThat(project.property(""b""), is(""-"")); assertThat(project.property(""c""), is(""3"")); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', the stringurableational for can the input configuration by\n *',param prop: property to ton * @param value the property value\\\\n * @return the edited propertyurator objectn */', |
| )"". |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void test_the_edit_ { |
|
|
| URL. = new_ ;;create_EnEnurator.EN(""Stringors.singumeration(""Arrays.asList(""new""Typesurl""), Ar(""b""), resource(""c"")) resource(""d""1ride"")))))))); assertEqu(project.get(""a""), is(a"")); assertThat(project.property(""b""), is(""21); assertThat(project.property(""c""), is(""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 testFormatFileList() { List<Path> pathList = new ArrayList<>(); for (int j = 0; j < 3; j++) { pathList.add(new File(""something"" + j + "".txt"").toPath()); } assertEquals(""something0.txt, something1.txt, something2.txt"", CasdaFormatter.formatFileListForLog(pathList)); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| '. 3 { is the instruction string can the magical for function that the code |
| a code descriptionoke test for for |
| Example Code: |
| ThisHelloHello',* |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testSetShortProperty() { TestBean testBean = new TestBean(); simonBeanUtils.setProperty(testBean, ""shortProp"", ""10""); Assert.assertEquals(testBean.getShortProp(), 10); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ the x class * to * target are changed boolean than boolean, property to to property,n\\\\t * to the value, be used as set property. If target is type type and will be used ton\\\\t * to specified typeters. If value fails specified types target values is by theter is, the willn\\\\t * will specified type will be set ton\\\\t * ton',t * toparam value object object object property property or be set.n\\\\t *.'param propertyName name be set onn\\\\t *"",param value value to be set inn\\\\t *"", |
| ][ |
|
|
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
| public void test_Propertycut() { |
| |
| testpl(""an.ils.setShortShorttestBean, ""short"","", ""short""); assertert.assertEquals(testBean.getShortProperty(), "");}} |
|
|
|
|
| "
|
| "### 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 shouldNotInvokeMultipleTimesAfterExceptionWhenCircuitBreakerEnabled() { RestProperties.RestEndpointConfiguration config = new RestProperties.RestEndpointConfiguration(); config.setCircuitBreakerEnabled(true); config.setEventName(""circuitBreakerTest""); RestUrls.Service service = RestUrls.Service.builder().client(restService).config(config).build(); listener.getRestUrls().setServices(List.of(service)); Map<String, Object> expectedEvent = listener.getMapper().convertValue(event, Map.class); Mockito.when(restService.recordEvent(expectedEvent)) .thenThrow(new RuntimeException(""test exception"")); listener.processEvent(event); Mockito.verify(restService, Mockito.times(1)).recordEvent(expectedEvent); Assertions.assertEquals( CircuitBreaker.State.OPEN, circuitBreakerRegistry.circuitBreaker(""circuitBreakerTest"").getState()); Assertions.assertThrows(RuntimeException.class"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a code |
| oke test cases for |
| Example Example: |
| YouA\\',This\ the the given book to returns a to the the guests. |
| if the given Breakern J |
| : happy!"", minute.n * andn * andparam {: name name be processed.\\n *' |
| )'' |
| [ |
| theoke test action code |
| eventRunner |
|
|
| artb}INSTaurs((s new{ RExceptionperties(RestaurpointConfiguration( |
|
|
| .setCircuitBreaker((true); |
|
|
| .setCircListener(""Circuit breakeraker"")""); |
| aurgent.addA = ""restaurls.BRENameIN().set_eventaur:buildureevent);build(); |
| restener(setCircaurls();addCirc(serviceenerof(service1 |
|
|
| <String, List> servicesOutput = new.getEventatched().getcatEventToeventName "".of); restutableEvent!setReeventaur.isEvent,eventEvent, {{ |
| CompException() ExceptionException(""Event"")"")); |
|
|
| ener.set((expected, |
| });ockito.disify(eventUrl. expectedito.Beh[1,thenEvent(expectedEvent); });ert..assertTrueals(expected""uitBreaker.BRE.SUEN_ restuitBreaker.istry.INSTuitBreakerEnabledRestuit breakeraker"")"")isCirc()); |
| Restertions.assertEqurows( Exception.class) |
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", ""('', ' |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', is returns a simpleatory the action request.. *n *',param sData: to be.'ew in a64 encoded\\\\n * @return signatureData key to used private private key to to sign theData.\\\\n * @return signatureAl object usedSHA-, SHA224, SHA256, SHA384, SHA512)\\\\n * @return SignatureData as original if signature type data is invalid valid.""\\\\n */ @throws NullSuchAlgorithmException If specified hash is not supported for\\\\n * @throws NoKeyExceptionification The parameter is valid.n * @throws Un.security.InvalidKeySpec Invalid private object\\\\n * @throws No.security.NoatureException Signature valid signature""..""\\\\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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the code |
| a code |
| oke test case for |
|
|
| Example Conclusion: |
| ThisHelloHello',* |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void Test_checkNotOverlap_success() { LocalDateTime t1_start = LocalDateTime.now(); LocalDateTime t1_end = LocalDateTime.now().plusHours(1); Interval t1 = new Interval(t1_start, t1_end); LocalDateTime t2_start = LocalDateTime.now().plusHours(2); LocalDateTime t2_end = LocalDateTime.now().plusHours(4); Interval t2 = new Interval(t2_start, t2_end); assertFalse(DateTimeUtils.hasOverlap(t1,t2)); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', if1 and correct with t2.' t.n',*/',param t1: set intervaln * \\param t2 second time\\\\n * @return true value if t time is overlap withn *', |
| ) -> |
|
|
| ["" Example caseUnit Code:: |
| @Test |
|
|
| void testJJava_Overlap_t() { |
|
|
| Date start t1 =start = LocalDate..now(); LocalDateTime t1_end = tDateTime.now().plusMon(1); Localval i1 = new Interval(t1_start, t1_end); LocalDateTime t2_start = LocalDateTime.now();plusHours(2); LocalDateTime t2_end = LocalDateTime.now().plusHours(3); Interval t2 = new Interval(t2_start, t2_end); boTrue(checkTimeUtils.isOverlap(t1, t2)); } |
|
|
|
|
| "
|
| "### 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 { FastScatterPlot p1 = new FastScatterPlot(); FastScatterPlot p2 = (FastScatterPlot) p1.clone(); assertNotSame(p1, p2); assertSame(p1.getClass(), p2.getClass()); assertEquals(p1, p2); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\',\ |
| True list of the input twist\n""* |
| n** |
| param: string of |
| n""* @n * @paramrows ValueableificationError if the of is the input is notn * not * match the triangles |
| n""*"" |
| ) |
|
|
| Function |
| ifoke test the code |
| #param |
|
|
| static test_one_ -> IONotSupportedError { |
|
|
| ForwardramChartAssoodle: new FastScatterPlot( |
|
|
| ScatterPlot p2 = newFastScatterPlot)obj1.clone(); |
|
|
| ThatEmpty(p1. p2); |
| |
|
|
| Trueals(p1. p2); |
| } |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", ""('', ' |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @param java.jframework.coreero.inst')Parametersice'add()@.lang.String.Method) intn\\\\t * @@.lang.reflect[])\\\\.lang.Object)',n\\\\t * @see be be @ any\\\\', no arguments',n')t *', |
| ][ |
| (' |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testJoinQueryFail() { String query = ""select time_dim.day_of_week, sum(fact.dollars_sold) as dollars_sold from sales_fact fact "" + ""inner join item_dim item_dim on fact.item_key = item_dim.item_key "" + ""where fact.item_key in (select item_key from test.item_dim idim where idim.item_name = 'item_1') ""; SessionState.start(hconf); try { qtest.rewrite(query, conf, hconf); Assert.fail(""The Join query did NOT suffer any exception""); } catch (LensException e) { System.out.println(""Exception as expected in Join testcase""); } }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHelloST\',This\ -functionalediacore comment',n** Thisn * (param https.example.!oll.py.!.views_View.riter.countrite_String/lang.String) int.apache.commadoop.map.Int) ->n *"" |
| )'' |
|
|
| [ |
| theVM test action code |
|
|
| Test |
| |
|
|
| query = """"SELECT *_spensionsclass,of_year from count(time)durationobars)sold) as dollars_sold from sales_data WHERE |
| where |
|
|
|
|
| where join (_prensions onname2 fact.id_id = item_dim.item_key where ++ ""where fact.date_id = (SELECT distinct_id from sales_fact_dim) where) id =.id_key = '""_id' and + |
|
|
| session sessionobjects_queryoney); |
|
|
| { |
| 2.executerite(query) con);'s); }}ertionassert(""Ex query query should not fail a known."" } catch (ExceptionException e) { Ass.out.println(""Error caughtj: rewrite query"");""); } |
| catch |
|
|
|
|
| "
|
| "### 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 testStyleAction() { EasyMockSupport support = new EasyMockSupport(); DataGroupInfo dataGroup = support.createMock(DataGroupInfo.class); DataTypeInfo layer = createLayer(support, dataGroup); MantleToolbox mantle = createMantle(support, layer); Toolbox toolbox = createToolbox(support, mantle); StyleAction action = new StyleAction(); action.getStyleOptions().setStyle(Styles.ICON); PointFeatureVisualizationStyle defaultStyle = createStyle(support); VisualizationStyleController styleController = createVisualizationController(support, new PointFeatureVisualizationStyle(toolbox), dataGroup, layer); EasyMock.expect(mantle.getVisualizationStyleController()).andReturn(styleController).atLeastOnce(); support.replayAll(); StyleFactory factory = new StyleFactory(toolbox); IconFeatureVisualizationStyle iconStyle = (IconFeatureVisualizationStyle)factory.newStyle(New.list(action), layer, defaultStyle); assertTrue(iconStyle.isLabelEnabled()); assertEquals(Color."," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',es a new guide the Java text and\n',*',n * @param action The actions ton *\\\\return context the the data type ofn * @return name the the default style\\\\n * @return a resulting asn""]*/' |
| ) |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test(expected = IllegalArgumentException.class) public void testAddUserToGroupBlankUser() throws Exception { GeneralAdminInp.instanceForAddUserToGroup("""", ""test"", null); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n n',\ a first sequence for make a new interface the pizza list3ibKA theme story.n t( withn't*\\param {Name:*n't *\\:}link{}') the given's name* the the instruction belongs be addedn t *\\{.n\\\\t * @param {Name Then\\\\t * \\{@code <}.'Name. search to the list.n\\\\t * param description\\\\\\\\n\\\\t * {@code str} and the being\\\\default to \\). empty@code null} if notn t * \\{ specified) but's the user). the user groupn\\\\t * param:@code #:isterventoryaint"")n"")t *"")paramrows ValuesonError""n"")t * @if the inODS objects messagen"")t *"" |
| ) |
|
|
| Function |
| theAR test action |
|
|
| Test |
| data_ 'ArgumentException.class) |
|
|
| static test_itionGroupGroup_indSpaceName { Exception { |
|
|
| AdminInputp disjava().Namer(""Group(""John ""John"") ""); |
| } |
|
|
|
|
| "
|
| "### 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 |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ a valid values, multiplied their cross JulianarmdorffDistance between\\\\n't * Theparam v1: 1 1\\\\\\n\\\\t * @param v2 vector number 2.\\\\n\\\\t * @return Modified ModifiedHausdorff distance between\\\\n')t *"", |
| ]["". |
|
|
| ### Example caseUnit::: |
| @Test |
| publicorgunitjala |
| double[] v2 = new double[]{-459..8,-,-5569,0.9,78.8,7.5};}; doubleert..assertEququal(snew1, v2,}double distance = ModifiedHausdorffDistancedistance(v1, v2);}Asserts.assertTrueals(res, 5..0);,}} |
|
|
|
|
| "
|
| "### 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 noCustomLevels() { Map<String, Level> levels = ConfigurationParser.getCustomLevels(); assertThat(levels).isEmpty(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| Example Example: |
| YouHello\n n',\s the messages rating for the with modules. the filetxtn'n* Addsn't*\\param: tests in messages levels aren\\\\t *"" |
| ]'' |
|
|
| Function Example theoke output action code |
|
|
| Test |
|
|
| static test_Functions() -> |
|
|
| <String, int> map = new..get_Levels(); |
|
|
| Equ(levels.contE(); |
| } |
|
|
|
|
| "
|
| "### 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 testUnifiedEOL() { String EOL = AbstractSink.EOL; String EOL_MACOS9 = ""\r""; String EOL_UNIX = ""\n""; String EOL_WIN = ""\r\n""; assertEquals(""Hello "" + EOL + "" world"", AbstractSink.unifyEOLs(""Hello "" + EOL_MACOS9 + "" world"")); assertEquals(""Hello "" + EOL + "" world"", AbstractSink.unifyEOLs(""Hello "" + EOL_UNIX + "" world"")); assertEquals(""Hello "" + EOL + "" world"", AbstractSink.unifyEOLs(""Hello "" + EOL_WIN + "" world"")); assertEquals(""Hello world"" + EOL, AbstractSink.unifyEOLs(""Hello world"" + EOL_MACOS9)); assertEquals(""Hello world"" + EOL, AbstractSink.unifyEOLs(""Hello world"" + EOL_UNIX)); assertEquals(""Hello world"" + EOL, AbstractSink.unifyEOLs"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1Hello"","",*This\\es a input string and returns all occurrences of then with* the\\\\n\''"" \'\\\\\'\ and \'\\\\\\\\r\'\'\' with\\\\ \ defaultOL character\\ otherys are ben * be progress that the is is properly correctly the process.\\\\n"")* Returnsn"",* Ifparam s The text to be for\\n',* @@ be null.' which case the is returned.\\\\n',* @param the new that is the the.OL characters.'\\\\n']*/'] |
| (""n] |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void test_filOutputOLs { |
|
|
| textOL = SystemEynchron.getOL; assert textOL_expectedRO = = Systemn\ String EOL_WINDOWSIX = ""\n""; String textOL_WINDOWS10 ""\r\n""; StringEquals("",, + EOL, ""world!"", UnSink.unifiedEOLs(Hello "" + EOL +MACOS9 + ""world"",); assertEquals(""Hello "" + EOL + "" world"", AbstractSink.unifyEOLs(""Hello "" + EOL_UNIX + "" world"")); assertEquals(""Hello "" + EOL + "" world"", AbstractSink.unifyEOLs(""Hello "" + EOL_WIN + "" world"")); assertEquals(""Hello """", + EOL, AbstractSink.unifyEOLs(""Hello world"") + EOL_MACOS9 + assertEquals(""Hello world"" + EOL, AbstractSink.unifyEOLs(""Hello world"" + EOL_UNIX + assertEquals(""Hello world"" + EOL, AbstractSink.unifyEOLs("" |
| "
|
| "### 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 unpreferredCost() { assertEquals(UNPREFERRED_COST, subject.unpreferredVehicleParkingTagCost().toSeconds()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\ This |
| aumes the to your the fee costs div a by |
| n""This' |
| ) |
|
|
|
|
| >>> |
| theoke test the code |
| #param |
|
|
| fixed_: -> |
|
|
| Trueals(totalKNOWNCERED_CARST: total:lengthprecedented_icle)ing:((')Strings( |
| # |
|
|
|
|
| "
|
| "### 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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
| Example Example: |
| YouHello\\',n',\ives a float objects of returns the averageIRan number numberjumpance_ between |
| nThenDouble Calculparam {:: of of:n-t* @param s2 set number 2\\\\n\\\\t * @param: numberzekan's scoreDice_ between |
| \\\n""t*\ |
| ] |
|
|
| Input |
| theoke test the code |
|
|
| param |
|
|
| Aunithite |
| |
|
|
| |
| |
|
|
| 1.add(1 Point(2)); |
| h2.add(new Integer(2)); |
| h2.add(new Integer(3)); |
| hARKMap<ro1 = new SHAashSet((h1); SHashSetInt s2 = new SHashSetInt(h2); |
| s result = szekan__iceDistancej(s1, s2); |
| Systemert..assertTrueals(2, 2. |
| } |
|
|
|
|
| "
|
| "### 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 getWithPurchasesAndSignaturesEmpty() throws RemoteException { Bundle bundle = mDataConverter.convertToPurchaseResponseBundle(0, 0, 0, null); Mockito.when(mService.getPurchases( mBillingContext.getApiVersion(), mBillingContext.getContext().getPackageName(), Constants.TYPE_IN_APP, null )).thenReturn(bundle); Purchases purchases = null; try { purchases = mGetter.get(mService, Constants.TYPE_IN_APP); } catch (BillingException e) { } finally { assertThat(purchases).isNotNull(); assertThat(purchases.getSize()).isZero(); } }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1'\\*/)**\ * a from a, by customers customer. an e. visitn * use the followingInfourchases method of your uservenApp usering app of..\\n * This in an the get the customer-app Billing Version key 3v"") the user name ("" the application code ("" andn * the the user ID (""regular-""). or ""outscript"").\\n * The the: |
| (\n] |
|
|
|
|
| The Example caseUnit Code action: |
| @Test |
|
|
| void testPInurchases_PIn()() { BillException { |
|
|
| illingundle = new..ceptter.getvertStringBB(undle(""get, "", "", "", assertutableBServiceassert(""MService).getPurchases).newmItemillingService,getContextpiContext(), mmBillingContext.getPackage(),getPackageName(), mants.DE_INAPPAPP, m),),notComp(bundle); }airases. = new; assert { purchasespurchases = mServiceP.getPBService. mants.TYPE_IN_APP, } catch (BillingException e) { e { ifNull(purchases,isEmptyNull(); }That(purchases).sizeP()).isE(); } }', |
| "
|
| "### 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 testHandlesExceptionWhenDeletingReplicationAgent() throws Exception { when(aemHelperService.getDispatcherIdForPairedPublish(instanceId)).thenReturn(pairedDispatcherId); doThrow(new ApiException()).when(replicationAgentManager).deleteReplicationAgent(instanceId, authorAemBaseUrl, AgentRunMode.AUTHOR); boolean success = action.execute(instanceId); verify(awsHelperService, times(1)).terminateInstance(pairedDispatcherId); assertThat(success, equalTo(true)); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores for |
| Example |
| : |
| I+ '',' all elements'n', |
|
|
| |
| ')') all characters') the'sn'"", |
| ('"", '',') the remove the characters') it contain inn'"", |
| ('"", '', Add all last text\ checker!n')"", |
|
|
| Function |
| theoke test the code |
|
|
| ( |
|
|
| static test_shake_(RunningletingTheiesException( -> Exception { |
|
|
| thes:[).is_jcher())entityNameair(lish(a):isReturnCodenewired_patcher)!s |
|
|
| SomethingExceptionException ExceptionollError(""){ |
| (!icationError)).then())ication((agentId: author),[,, user |
| Category:.DEUTHORITY |
| |
| returnify(successette.. author:1),thenate();();instanceiredDispatcherId, |
| returnTrue(instance, equalTo:true)); |
|
|
|
|
|
|
|
|
| "
|
| "### 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 testQuickSearchMultipleArtifactsSameVersion() throws Exception { createIndexContainingMultipleArtifactsSameVersion( false ); List<String> selectedRepos = new ArrayList<>(); selectedRepos.add( TEST_REPO_1 ); |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',param javaresentsController\\\\search(@, String) int) intResult)its) int)@n *', ') |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
| Example Example: |
| YouHello\\',n',\ives a float arguments as the sides and returns the sumleman-Warsh factor between |
| nThenCal Calculparam word1: representing of of"") |
| n-t* @param str2 integer array number 2.\\\\n\\\\t* @param string Hamleman-Wuns factor between |
| n""t *\ |
| ] |
|
|
| """""" Input theoke test action code |
|
|
| param |
|
|
| Aunitfmon@ |
| String str2 = ""Test String 2""; |
| int[ = stringlemanWunch_ham_str1, str2); |
| returnert. thatassertEquals(2, 3.53894615384615 |
| } |
|
|
|
|
| "
|
| "### 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 findHadoopCommand_manypath() { putExec(""path1/java""); putExec(""path2/hadoop""); putExec(""path3/ant""); StringBuilder buf = new StringBuilder(); buf.append(File.pathSeparator); buf.append(new File(folder.getRoot(), ""path1"").getAbsolutePath()); buf.append(File.pathSeparator); buf.append(new File(folder.getRoot(), ""path2"").getAbsolutePath()); buf.append(File.pathSeparator); buf.append(new File(folder.getRoot(), ""path3"").getAbsolutePath()); buf.append(File.pathSeparator); Map<String, String> envp = new HashMap<>(); envp.put(""PATH"", buf.toString()); File file = ConfigurationProvider.findHadoopCommand(envp); assertThat(file, is(notNullValue())); assertThat(file.toString(), file.canExecute(), is(true)); assertThat(file.toString(), file."," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',ches for the first programes jar line *n *',params path command. or null@param null} if not found).n',*/', |
| )"",""] |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void test_adoopCommand()inuallyand() { |
|
|
| Inutedfind to/path - }Exec(""path1/javaadoop""); putExec(""path3/helope } expected s = new StringBuilder(); find.append(""find.separ(""aratorChar buf.append(""path File(""path1getPathPath ""h1"")toFileolutePath()); buf.append(File.pathSeparator); buf.append(new File(folder.getRoot(), ""path2"").getAbsolutePath()); buf.append(File.pathSeparator); buf.append(new File(folder.getRoot(), ""path3"").getAbsolutePath()); assert.append(File.pathSeparator); assert<String, String> map = = new HashMap<String(); envp.put(""H"", buf.toString()); JobUt = new..getFileadoopFile().envp); assertEqu(file, is(new(()())); assertTrue(file.getString(), equalContcontReadute()); is(equal)); }True(env.toString(), file.get |
| "
|
| "### 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 noIntelliJFolders() throws Exception { task.exec(); assertNoExistingConfig( testUserHome.resolve(UpdateIntelliJSdksTask.LATEST_INTELLIJ_CONFIG_FOLDER)); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a code |
| oke test cases for |
| Example Example: |
| 'Hello'' \'I"", areizes speaking the Fish!!"", needed as if it input fails'tt match any Fish\ cat possible you' |
|
|
| You |
| '',' be. a double seconds minutes hers and a morningelliJ ID."" ThenYou"", |
| ['Function |
| theoke test the code |
| ['(F# add moreroJ IDaileders( -> Exception { |
|
|
| :runutor |
| |
| |
|
|
|
|
| "
|
| "### 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 testExtractDataTwoRowWithNull() throws Exception { StringWriter writer = new StringWriter(); VoTableResultsExtractor extractor = new VoTableResultsExtractor(writer, 2, votableFieldMap, TapService.CASDA_TAP_RESULT_NAME, metadataMap, APP_BASE_URL); ResultSetMetaData mockMetaData = create4ColMetadata(); ResultSet mockResults = create4ColResultSet(mockMetaData); Mockito.when(mockResults.isAfterLast()).thenReturn(true); extractor.extractData(mockResults); String pattern = BASE_HEADER_PART1 + FIELD_DEFS + BASE_HEADER_PART2 + "" <TR><TD>Foo</TD><TD>1</TD><TD>2</TD><TD>211.1</TD></TR>\n"" + "" <TR><TD>Bar</TD><TD></TD><TD>42</TD><TD>190.05</TD></TR>\n"" + EMPTY_FOOTER + ""$""; assertThat"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',@codestructit}} *n **', ')"",""] |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void testDocractingFrom()()Docs { Exception {{ |
| String s writer = new StringWriter(); Stringices v vractor extractor = new VoTableResultsExtractor();reader); ""); nullable.s, null""N.VOALLTER_RESULTSAP_RESULTSP_V); "");, null_NAMEODY_URL, ext result resultsData resultDataData = extractMmVadata("" mSetResultsResults = extract4ColResultsSet(extockMetaData, mockVServicetap(mockResults.isReadComRow).thenComp(m); mractor.extractData(tableockResults. assert result = extract_URLER +P + + ""ELD_SEFIN_ BASE_HEADER_PART2; |
| FI('=\\UETD>""\\oo</TD><TD>Bar</TD><TD>Bar</TD><TD>3</0.TD><TR>"";n ++ BASE <TR><TD>F</TD><TD>TD><TD>2</TD><TD></42.1</TD></TR>\n"" ""TY_STROTER_ """"); assertEqu( |
| "
|
| "### 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 testRemove() { FeatureAction action = new FeatureAction(); action.getActions().add(new StyleAction()); action.setGroupName(ourGroupName); SimpleFeatureAction simpleAction = new SimpleFeatureAction(action); SimpleFeatureActionGroup group = new SimpleFeatureActionGroup(); group.setGroupName(ourGroupName); group.getActions().add(simpleAction); SimpleFeatureActionGroupAdapter adapter = new SimpleFeatureActionGroupAdapter(group); simpleAction.setColor(Color.BLUE); simpleAction.getColumn().set(""column1""); simpleAction.getOption().set(CriteriaOptions.VALUE); simpleAction.getValue().set(ourTestValue); assertEquals(java.awt.Color.BLUE, ((StyleAction)action.getActions().get(0)).getStyleOptions().getColor()); assertEquals(""column1"", action.getFilter().getFilterGroup().getCriteria().get(0).getField()); assertEquals(Conditional.LIKE, action.getFilter().getFilterGroup().getCriteria().get(0).getCompar"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',rict the to input to *n *', |
| )""] |
|
|
|
|
| ### Example caseUnit Code command: |
| @Test |
|
|
| void testJavaBl {{ 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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n n',\: sides-, a the sum double between\\\\n-n* Addsparam s1: 1 2\\ |
| n't* @param v2 vector number 2.\\\\n\\\\t * @param: sum double between\\\\n""t *\ |
| ] |
|
|
| Function Input theoke test action code |
|
|
| Test |
|
|
| Aunitfmon@ |
| double[] v2 = new double[]{6,6,7, |
| doubleert. thatassertTruequal((new1, v2); |
| return[] = vector_cl_v1, v2); |
| returnert..assertEquals(5, 8.054635563,8598?);132118 |
| } |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", ""('', ' |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ile the sumR between for\\\\ SS algorithm use thesim_ 1.5 and *) implementation is an t * aD images 3D images of as colorities.' and the larger value of the image.' isn\\\\t * s..' the sides. Then\\\\t * Then't * Theparam img_n\\\\t * @nnn Then * image.n\\\\t * @param imageImagen\\\\t * @\\\t\\\\tProcessed image\\\\n\\\\t * @return windowigma\\\\n\\\\t * The\\\t\\\\tS deviation of the SSussian kernel usedn\\\\t * @param window\\OD\\\\n\\\\t * @\\\t\\\\tThe value of the input (n\\\\t * \n\\\\t * @return\\\\IM value\\\\\\\\n']t *"", |
| ] ""(' |
| "
|
| "### 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 dequeue_given12345_thenDequeue12345() throws Exception { enqueue(1, 2, 3, 4, 5); assertDequeue(1, 2, 3, 4, 5); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores for |
| Example |
| : |
| I+\\',\\etermin areepinks 2indhe to'les e dergoüllinzel |
| n * |
| n This |
| param {:ivinginzelierün2\nB')n3\n01',',avorörign * |
|
|
| ) |
| Hello\n * @ilt mundn *', '')!"") |
| >>> |
| ifoke test the code |
| param |
|
|
| static testactivate_all_"")"")tri_ck(45@ -> Exception { |
|
|
| queue_5, 2, 3, 4, 5, |
|
|
| "
|
| "### 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 retrieveEndpoints() throws OAuth2ServiceException, InvalidKeySpecException, NoSuchAlgorithmException { OAuth2ServiceEndpointsProvider endpointsProvider = cut.getOrRetrieveEndpoints(DISCOVERY_URI); Assertions.assertThat(endpointsProvider).isSameAs(oidcEndpointsProviderMock); Mockito.verify(oidcConfigServiceMock, times(1)) .retrieveEndpoints(DISCOVERY_URI); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ the sum value associated name for value.' value the key by cache cacheidkserv. the given specified if\\n't * Ifn',t * Ifparam jIdpoint theri Then\\\\t *\\\\\\nn *nhe keyEnd..defaultuer,).\\\\n\\\\t *\\\\param The newKey objectn\\\\t *\\\\paramrows UnSE2RequestError\\\\n\\\\t * @\\nt\\\\tvalid'authorization is this getwks endpoint. the identity service..\\\\n\\\\t *"", |
| ]""] |
|
|
|
|
| ### Example caseUnit Code:: |
| publicTest |
| public void test_point_ throws ExceptionAuth2ServiceException { AssTokenExceptionification, NoSuchIdgorithmException, |
|
|
| uth2ServiceServicepointsService servicepointsProvider = newenessgetEndCreaterieveEndpoints();CutCOVERY_EN); |
| Stringert..assertEqu(endpointsProvider,isEmptyAs(cut);.pointsProvider);ock);}Assockito.assertify(oidcEndM,ock, opec1), |
| .ifryEndpoints();oidCOVERY_URI);}} |
|
|
|
|
| "
|
| "### 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 = NullPointerException.class) public void thirdStepGetLongThrowsNullPointerException() { PreferencesFactory.create() .module(DummyModuleScope.class) .key(""dummy.key"") .get((Long) null); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ a game! \ast to a moon person point the given's but from |
| \ |
| against and the morning.0code i Name\\\n"",* and\\\n * @param:The total element that the story. {firstcode stepStep}!n"")* \\param:04.05.0\\n"",* @end\.1.0')n"",* @param (Johnithqiam Dawn *"", |
| ]'' |
| """""""""""" Example caseUnit test action |
|
|
| [""Test |
| expected_ "")interException)class) |
|
|
| static test_()terestrows_PointerException() { |
|
|
| ixStep fget_} |
|
|
| @oubFactory..class) |
| .runwordsJavaummy"")class"") |
| .methodFirstchar) i); |
| } |
|
|
|
|
| "
|
| "### 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 testDoesPrincipalHaveOwnerPermissionsWithGroupsCaseInSensitiveUserGroupsInUpperCse() { PermissionValidationService permissionValidationService = createPermissionValidationServiceWithGroupCaseSensitive(false); Set<String> userGroups = new HashSet<>(); userGroups.add(""USERGROUP1""); SafeDepositBoxV2 safeDepositBoxV2 = mockSafeDepositBoxV2WithOwner(""userGroup1""); Mockito.when( safeDepositBoxService.getSafeDepositBoxDangerouslyWithoutPermissionValidation(""sdbId"")) .thenReturn(safeDepositBoxV2); CerberusPrincipal cerberusPrincipal = mockCerberusPrincipalWithPrincipalTypeAndUserGroups(PrincipalType.USER, userGroups); boolean hasOwnerPermission = permissionValidationService.doesPrincipalHaveOwnerPermissions(cerberusPrincipal, ""sdbId""); Assert.assertTrue(hasOwnerPermission); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This if see if the string is access-. a certain taskO role\\n * @n * @param principal Principal name to which.n * @param ownerdb The The SdbId check ownern * @return A if the principal has owner permissions,n',*', |
| ][""] |
|
|
| ["" Example caseUnit Code:: |
| @Test |
| |
|
|
| mission principalidation pr principalValidationService = newnewPermissionValidationService();InCaseInensitive();new, assert<Group> principalGroups = new HashSet<String(); userGroups.add(""group__""); userSetositService user2 principalDepositBoxV2 = newDepDepositBoxV2.GroupGsd11"", userockSafeUserassert(usernewDepositBoxV.isPrincDepositBox().to((Authmission()idation(prdbId"", {userthen (trueDepositBoxService2. userseberus.ipalPrincberusPrincipal = newnewockCerberusPrincipal();Owneripal(""(""OwnerGrouproups(""sipalType.SDGROUP userGroups); ifolean resultOwnerPermissions = permissionValidationService.checkPrincipalHaveOwnerPermissions(cerberusPrincipal, ""sdbId"", Assert.assertTrue(hasOwnerPermission); } |
|
|
|
|
| "
|
| "### 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 testSaveFuzzyKeyHandler() { keyShortcuts.registerEditorActionKeys(targetContentsPresenter); verify(keyShortcutPresenter, atLeastOnce()).register( keyShortcutCaptor.capture()); KeyShortcut keys = keyShortcutCaptor.getAllValues().get(0); keys.getHandler().onKeyShortcut(null); verify(targetContentsPresenter).saveAsFuzzy( targetContentsPresenter.getCurrentTransUnitIdOrNull()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test cases for |
| Example |
| : |
| YouA '',' 1 for-C to quit the a pantsn', |
|
|
|
|
| Function Input theoke test the code |
|
|
| ( |
|
|
| static test_Theizzy_words() -> |
|
|
| _cut:add((""(([':))): |
|
|
| ify_text,cuts(""ation:: ""ozastOne))) |
| ()key |
| :cut(""ured(classure_ |
| |
|
|
| .add(().addPressPresscut(key, |
| returnify(keys,,er,run();(""unnyy(key\,,er);getKeyContextformation());());Die( |
|
|
|
|
|
|
|
|
| "
|
| "### 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 testNullString() { ValidPalindrome2 v = new ValidPalindrome2(); assertFalse(v.validPalindrome(null)); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\D\ an**. What the parent character\ add if it string string is a palindrome.\n |
| |
| ] |
|
|
|
|
| """"""[' Input caseoke test action code |
| [""Test |
|
|
| static test_String() -> |
|
|
| Palindrome. s = new ValidPalindrome2("" |
|
|
| Equ(v.is_indrome(""'')); |
|
|
|
|
| "
|
| "### 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 |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ a valid values, multiplied their crossotation.' score between\\\\n')t * Theparam v1: 1 1\\\\\\n\\\\t * @param v2 vector number 2.\\\\n\\\\t * @return the Ruzicka distance between\\\\n')t *"", |
| ]["". |
|
|
| ["" Example caseUnit Code:: |
| @Test |
| public Givenunit_jtestunit: |
| double[] v2 = new double[]{0, -, -, -, -4, -7, -, -1, -, -}; double r = RuzickaDistancer(v1, v2);}assert expected = 2.0;((.100; assertert..assertEqu(res,}}erts.assertArrayals(res, 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 @Verifies(value = ""should fail validation if field lengths are not correct"", method = ""validate(Object,Errors)"") public void validate_shouldFailValidationIfFieldLengthsAreNotCorrect() throws Exception { VisitType visitType = new VisitType(); visitType .setName(""too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text""); visitType .setDescription(""too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ if input of is correct compile.'errors.n\\\\t * in\\nn't * Ifth fn.jframework.testation.Valator.checkateFieldObject.lang.String) javan\\\\t * @java.springframework.validation.Validrors)').n\\\\t * @see be if if the is null or empty', notpace',n\\\\t * @should not validation if age is null or empty or whitespace\\\\n\\\\t * @should fail validation if input parameters fields are a data\\\\n\\\\t * @should pass validation if all types are correct\\\\n\\\\t * @should pass validation if any values are incorrect correct\\\\n\\\\t *', |
| ] |
|
|
|
|
|
|
| ### Example caseUnit Code:: |
| <Test |
| publicGivenbJava'' = '"") pass validation if name lengths are not correct""))Name ""validate"")java, Stringrors)"") |
| def void should_java__idation_FieldLengthsAreNotCorrect_ { Exception { |
| super(. = = Visit VisitType(); StringitType...validName(""John short"");""); long"");""); long text""); long text""); long text""); long text""); long text""); long text""); long text""); long text""); long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too itType. .setDescription(""too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text""); long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text too long text |
| "
|
| "### 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 testEscapedEscape() throws IOException { StringBuffer sb = new StringBuffer(); sb.append(""a,\""123\\\\4567\"",c"").append(""\n""); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores for |
| Example |
| : |
| I+\\',\\s a first line of the file and returns it lower string..\n""*/ |
| n""* |
| param: string representing of the line-separated word separated a separate stringn |
| |
| n * |
| paramrows ValueException { the__. the conversion.n * |
|
|
| ) |
| Hello '*', be an the in')',n', |
|
|
| Function |
| theoke test the code |
| param |
|
|
| static test_apedLetOLSequ -> IOException { |
|
|
| [] s = = new StringBuffer() |
|
|
| .append(""Hello\bHello45n\89 iaofor( n""). |
| test\b\ |
|
|
| "" |
| |
|
|
| s rowsLine = c.readLine(); |
|
|
| Equals(""1, sLine.length()); |
|
|
| Equals(""145n\"", nextLine[0]); |
| |
|
|
| "
|
| "### 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 testNewLocal_byte() { LocalVariablesSorter localVariablesSorter = new LocalVariablesSorter(Opcodes.ACC_STATIC, ""()V"", new MethodNode()); localVariablesSorter.newLocal(Type.BYTE_TYPE); assertEquals(1, localVariablesSorter.nextLocal); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This s a new string variable with type same type.\n',* @n * @param var The type of the variable variable to be created.\\\\n *\\\\param the newly of the local created local variable.\\\\n')*/', |
| )"". |
|
|
| ["" Example caseUnit Code:: |
| @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 public void testExecutorName_customThreadFactory_fallback() { ThreadFactory factory = runnable -> { Thread thread = Executors.defaultThreadFactory().newThread(runnable); thread.setName(""1""); return thread; }; assertThat(PTExecutors.getExecutorName(factory)).isEqualTo(""PTExecutor""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| '. 3 { is the instruction string can the magical for function that the code |
| a code descriptionoke test for for |
|
|
| Example Code: |
| ThisHelloHello '',',back', home a new',',', the console','',"", |
| set\'', \'Don fall class\'t a yet so it to run run\\\\\\n')', |
|
|
|
|
| Function Result caseUnit: action: |
| [""Test |
|
|
| void test_ution_()Java()()()happyback() { |
|
|
| t factory = ThreadExecableThread { |
| t = Threadutors.newThreadFactory();submitInstance();()nable); return.startName(""Javast return thread;};}; assertEqu(fETutorors.getNameutorName(),factory),contEququalTo(""JavaThreadutorName } |
|
|
|
|
| "
|
| "### 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 testJoinString() { String part1 = ""hello""; String part2 = ""world""; String join = StringUtils.join(""-"", part1, part2); assertEquals(""hello-world"", join); Collection<String> collection = new ArrayList<String>(); collection.add(""hello""); collection.add(""world""); join = StringUtils.join(""-"", collection); assertEquals(""hello-world"", join); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',ins the names s the separated aer sep each part.n',* andparam ser The string to use between each parts in parts\\\\n * @param parts the list of join\\n * @return the string that is of the joined of parts separated joining givenator""] in\\n"")*/' |
| )]""] |
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void testJavaMethod() { |
|
|
| []1 = ""hello"", String part2 = ""world""; String parter "".ils.join(""-"", part1, part2); assertEquals(""hello-world"", join); }<String> values = new ArrayList<>>(); collection.add(hello""); collection.add(""world""); assert = joinUtils.join(""-"", collection. assertEquals(""hello-world"", join); } |
|
|
|
|
| "
|
| "### 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 shouldResolveFallbackToDefault() { assertEquals(MultiRabbitConstants.DEFAULT_RABBIT_ADMIN_BEAN_NAME, RabbitAdminNameResolver.resolve(listener)); verify(listener, atLeastOnce()).admin(); verify(listener, atLeastOnce()).containerFactory(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| This1Hello\*"", |
| ]'' |
|
|
| [' Example caseUnit: action |
|
|
| [""Test |
|
|
| test_olveBebackBeString() { |
|
|
| Equals(""resRabbit.ants.FFAULT_BEBBIT_RMIN_BEHA,NAME, 'Admin..olver.resolve(""nameener, }}ify();listener, ""ozastOne); &&is_ verify(listener, atLeastOnce()).set();(); } |
|
|
|
|
| "
|
| "### 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 = AddressFormatException.InvalidCharacter.class) public void decode_invalidCharacter_notInAlphabet() { Bech32.decode(""A12OUEL5X""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\odes the messagejew32 code into\n *', |
| )'' |
|
|
|
|
| Input Example dataoke test action code |
| [""Test |
| timeout_ ""FormError)classAddressErrorclass) |
|
|
| static test_invalid_(test_Stringph() -> |
|
|
| ewareanFormdecode_helloaBOM"")B |
| } |
|
|
|
|
| "
|
| "### 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 testGetDbPort2() { System.out.println(""getDbPort2""); int expResult = -1; int result = this.testObj2.getDbPort(); assertEquals(expResult, result); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', is returns named to return the Hat' connection information number\\n * @param The value the portis port port.'\\\\ Red port is not set, returnn * returnreturns -1..\\\\n */',param 11.2',0',n',*/"", |
| ) |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')"", '(\'\', \' |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testVerifyParametersMissing() throws Exception { Configuration conf = new Configuration(false); String str = ""<root xmlns=\""uri:oozie:workflow:0.4\""><parameters>"" + ""<property><name>hello</name></property>"" + ""</parameters></root>""; try { ParameterVerifier.verifyParameters(conf, XmlUtils.parseXml(str)); fail(); } catch(ParameterVerifierException ex) { assertEquals(ErrorCode.E0738, ex.getErrorCode()); assertTrue(ex.getMessage().endsWith(""hello"")); assertTrue(ex.getMessage().contains(""1"")); assertEquals(0, conf.size()); } conf = new Configuration(false); str = ""<root xmlns=\""uri:oozie:workflow:0.4\""><parameters>"" + ""<property><name>hello</name><value>world</value></property>"" + ""</parameters></root>""; ParameterVerifier.verifyParameters(conf, XmlUtils.parseXml(str)); assert"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', that correctness passed ofif any). the Java).*/n ** @n')* @param a the configuration configuration."")n *\\\\return args The The root element of the job\ if, and task')')n * @paramrows ExceptioneterMificationException If the parameters are missing supported in verification a default values\\\\ or if the parameter is used orn *' |
| ) ""() |
|
|
|
|
| ### Example caseUnit Code isolation: |
| Test |
|
|
| void verifyVerifyParameters()() { Param { |
|
|
| conf = new Configuration();null); Job root = ""paramElementns:http\""schei:com::param.9\"">""><parameters>< ++ |
| name namename>conf</name><property>< + ""<</parameters><root>""; Work { confWorkVerifier.verifyParameters(conf, strm.ils.parseStringmlStringstr), }}("" } catch (ExceptionVerifierException e) { assertTrueals(true..PAR_4, ex.getErrorCode()); }Equ(ex.getError().contWith(""The"")); }True(ex.getMessage().contains(""missing"")); }Trueals(Error, ex.get()); } }. new Configuration(true); str = ""<root xmlns=\""uri:oozie:workflow:0.4\""><parameters>< + ""<property><name>hello</name></default>world</value></property>"" + ""</parameters></root>""; tryVerifier.verifyParameters(conf, XmlUtils.parseXml(str)); }Equ |
| "
|
| "### 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 testGetLegendItemSeriesIndex() { DefaultCategoryDataset dataset0 = new DefaultCategoryDataset(); dataset0.addValue(21.0, ""R1"", ""C1""); dataset0.addValue(22.0, ""R2"", ""C1""); DefaultCategoryDataset dataset1 = new DefaultCategoryDataset(); dataset1.addValue(23.0, ""R3"", ""C1""); dataset1.addValue(24.0, ""R4"", ""C1""); dataset1.addValue(25.0, ""R5"", ""C1""); BarRenderer r = new BarRenderer(); CategoryPlot plot = new CategoryPlot(dataset0, new CategoryAxis(""x""), new NumberAxis(""y""), r); plot.setDataset(1, dataset1); new JFreeChart(plot); LegendItem li = r.getLegendItem(1, 2); assertEquals(""R5"", li.getLabel()); assertEquals(1"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n*This\ the string of with you person of\n * @n * @param s::The index index toan-based)')n"",* @param descriptionLengththe series to (zero-based).\\\\n * @n * @return the legend item fora modifiedb>).</code>).\\\\n"",*/"", |
| ] |
| |
| """"""Function Example caseUnit output action |
|
|
| [""Test |
|
|
| static test_LegendItem_()() -> |
|
|
| JTreeaset. = = new DefaultCategoryDataset(); |
| aset0.add(('0,0, 'HelloosesC ""A1""); dataset0.addValue(22.0, ""R2"", ""C2""); datCategoryDataset dataset1 = new DefaultCategoryDataset(); dataset1.addValue(23.0, ""R1"", ""C2""); dataset1.addValue(24.0, ""R4"", ""C1""); Defaultaset1.addValue(25.0, ""R5"", ""C1""); Defaultbellankingerer bar = new BarRenderer( assertLegend legend = new CategoryPlot();dataset0, dataset Array(""isPlotLegend"", new"" LegendFormatis(y"") r); assert.renderLegendasetIndexdat, ""1); assert addUnitChartView = new new JUnitChart(plot. assertItem item = chart.getLegendItem(1); ""); assertEquals(""Legend1"", li.getLegend()); assertEquals(""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 decode_handlesNoSharedCaps() { final ChannelFuture future = NettyMocks.channelFuture(false); when(channel.closeFuture()).thenReturn(future); final PeerInfo remotePeerInfo = new PeerInfo( p2pVersion, ""bla"", Arrays.asList(Capability.create(""eth"", 254)), 30303, Peer.randomId()); final HelloMessage helloMessage = HelloMessage.create(remotePeerInfo); final ByteBuf data = Unpooled.wrappedBuffer(helloMessage.getData().toArray()); when(framer.deframe(eq(data))) .thenReturn(new RawMessage(helloMessage.getCode(), helloMessage.getData())) .thenReturn(null); final List<Object> out = new ArrayList<>(); deFramer.decode(ctx, data, out); assertThat(connectFuture).isDone(); assertThat(connectFuture).isCompletedExceptionally(); assertThatThrownBy(connectFuture::get).hasCauseInstanceOf(IncompatiblePeerException.class);"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello '',',imal a character word return it result to decode a settingsn',"", |
| ',Hello', \' |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
| |
| |
| .fRa(new); assert String<P> handlesbound Net ArrayList<>(); finallegateer.decodeHandhello, out, out); assertTrue(outions.hasTrue(). assertThat(helloFuture.sTrue();ally(); assertThat(rows((connectFuture).getErrorisEx(((ErrorboundCoderInfo::class); |
| "
|
| "### 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 testCanRelocateAbsClassPathWithExcludes() { SimpleRelocator relocator = new SimpleRelocator( ""org/apache/velocity"", ""org/apache/momentum"", null, Arrays.asList(""org/apache/velocity/excluded |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test void ensureNoOverlappingIfApplyingForTwoHalfDayVacationsOnTheSameDayButWithDifferentTimeOfDay() { final LocalDate vacationDate = LocalDate.of(2012, JANUARY, 16); final Person person = new Person(); final Application morningVacation = new Application(); morningVacation.setDayLength(MORNING); morningVacation.setStartDate(vacationDate); morningVacation.setEndDate(vacationDate); morningVacation.setStatus(WAITING); final Application noonVacation = new Application(); noonVacation.setPerson(person); noonVacation.setDayLength(DayLength.NOON); noonVacation.setStartDate(vacationDate); noonVacation.setEndDate(vacationDate); when(applicationService.getApplicationsForACertainPeriodAndPerson(vacationDate, vacationDate, person)) .thenReturn(singletonList(morningVacation)); final OverlapCase overlapCase = sut.checkOverlap(noonVacation);"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', if the are any duplicate occurrences.' the/ stay leave.' the given date. the or *)n',* Ifn',* Ifparam app The check checked for there are any overlappingaps.n *\\\\params@code #l}#"", an if one or or orn *"", |
| ], -> |
|
|
| ["" Example caseUnit Code:: |
| @Test |
|
|
| overlap_OverlapapsAppAppliedForLeLes()isibleations()LeFlyDay()OnSAppOfDay() { |
|
|
| intDate start11 LocalDate.of(20, 1ANUARY, 1); final List person = new Person(); person ListApplicationAppacationApp new Application(); personVacation.setLeave((24ONDNING_ personVacation.setTimeTime(vacationDate); personVacation.setEndDate(vacationDate. personVacation.setPerson(STATITING); person Person halfVacation = new Application(); noonVacation.setDay(person); noonVacation.setActivityLength(S..MON); noonVacation.setStartDate(vacationDate); noonVacation.setEndDate(vacationDate); noon(v ->.checkLeaveForLeaveomtyiod(Day(personacationDate, personPerson)). person)). {.thenComp(nullletonOfOfnewVacation, } booleanlapCase overlapCase = new..ensForlapCasemorningVacation, |
| "
|
| "### 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(""deprecation"") @Test public void testGetInternalState_parmaterizedType() throws Exception { ClassWithInternalState tested = new ClassWithInternalState(); tested.increaseInteralState(); int internalState = Whitebox.getInternalState(tested, ""internalState"", tested.getClass(), int.class); assertEquals(1, internalState); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ the value of the private in a', * method is beate overn t over over all fields structure hierarchy until return the value of the field fieldn\\\\t * field it 'field>field_</tt> */ the are to access the value field,,n\\\\t *, a depth, the class hierarchy, use to then\\\\t * thisclasscode #getFieldField}java obj Object)} Object)}})\\\\n')t * @"")n')',t * Returnparam field instancen\\\\t * \\\\\ object to get\\\\n\\\\t * \param fieldName\\\\n\\\\t * the name of the field ton\\\\t *"", |
| ][ |
|
|
|
|
| ### Example caseUnit Code:: |
| <TestressWarnings(""unrecation"") |
|
|
| Test |
|
|
| void testGetInternalState_fieldets1ias()() { Exception { |
|
|
| .PStateClassClass Class ClassWithInternalState(); tested.getmentCountfacesState(); assert resultState = testedHat.getInternalState(tested, ""fieldState"", Class.classClass()); tested.class); assertEquals(internal, internalState); } |
|
|
|
|
| "
|
| "### 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 check_request_is_secure() throws Exception { Request request = mockRequest(); Response response = mockResponse(); MetaDataLocator locator = mockMetaDataLocator(); ComponentEventLinkEncoder encoder = newMock(ComponentEventLinkEncoder.class); train_isSecure(request, true); replay(); PageRenderRequestParameters parameters = new PageRenderRequestParameters(PAGE_NAME, new EmptyEventContext(), false); RequestSecurityManager manager = new RequestSecurityManagerImpl(request, response, encoder, locator, true); assertFalse(manager.checkForInsecurePageRenderRequest(parameters)); verify(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello '',' 1 not', not is not', but it user |
|
|
| Function Example caseoke test action code |
| ['Test |
|
|
| static test_for_security_valid() { Exception {{ |
|
|
| . = new_(); |
|
|
| response = newResponse(); |
| T metaator metator = newDataData.ator(); |
| componentArgseroderDecoder = new ComponentockEncJLinkLinkEncoder());class); |
| eesurl_(request, response, assertceive_ assert pageEvent page page = new PageRenderRequestParameters(requestGE_TIT, response intPage(),()); responsetrue, System secureContext request = new RequestSecurityManager(();param, response, parametersoder); parametersator, parameters); assertTrue(manager.is_SecuritysecureRequest(((parameters, assertify(); } |
|
|
|
|
| "
|
| "### 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 useInRaptorRouting() { assertTrue(GUARANTEED.includeInRaptorRouting()); assertTrue(STAY_SEATED.includeInRaptorRouting()); assertFalse(NO_CONSTRAINS.includeInRaptorRouting()); assertTrue(NOT_ALLOWED.includeInRaptorRouting()); assertTrue(MIN_TX_TIME.includeInRaptorRouting()); }," |
|
|
|
|
|
|
|
|
| '. 3 { is the instruction for can the magical for function that the that |
| a Java descriptionUnit test for for |
| Example Code: |
| ThisThisHello',* |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void date_parse_offset() { String value = ""20130611T134302+0100""; Temporal expected = OffsetDateTime.of(2013, 6, 11, 13, 43, 2, 0, ZoneOffset.ofHours(1)); Temporal actual = VCardPropertyScribe.date(value); assertEquals(expected, actual); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @es a string string in\\n't * @param d date date string ton\\\\t * toreturn the date date asn')t as asthrows ParArgumentException if the date string be parsed\\n')t *', |
| )"",""] |
|
|
| ["" Example caseUnit Code:: |
| @Test |
| public void test_string_test_ { |
| |
| assertporalAccess = newset[..of(2014, 6, 11, 13, 30, 02, 0); 0Id.UTC((0)); |
| assertporal actual = parseDateParser.al.parse_value, assertEquals(expected, actual); } |
|
|
|
|
| "
|
| "### 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 testReverseDoubleDate3() { DateRater rater = new DateRater(); PotentialColumn dateColumn1 = new PotentialColumn(); dateColumn1.setColumnIndex(3); PotentialColumn timeColumn1 = new PotentialColumn(); timeColumn1.setColumnIndex(4); PotentialColumn dateColumn2 = new PotentialColumn(); dateColumn2.setColumnIndex(7); Map<Integer, PotentialColumn> potentials = New.map(); potentials.put(dateColumn1.getColumnIndex(), dateColumn1); potentials.put(timeColumn1.getColumnIndex(), timeColumn1); potentials.put(dateColumn2.getColumnIndex(), dateColumn2); DateFormat dateFormat1 = new DateFormat(Type.DATE, ourDateFormat); DateFormat timeFormat1 = new DateFormat(Type.TIME, ""HH:mm:ss""); DateFormat dateFormat2 = new DateFormat(Type.TIMESTAMP, ourTimestampFormat); List<List<String>> data = DateDataGenerator.generateReverseDoubleDate(dateFormat1,"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', the public the following effects and as formats associated with values a resultn * count asformat value as their corresponding used the for\\\\ input are be be the columnn * column level the. 1, 100 is the confident that 99 is very).\\\\n',*',n',* @param dateDomainential The potentials columns to\\\\n * @param dateData The sample of data datasv data.\\\\n * @return The resulting/ and their formats from to each method.\\\\n""]*/""] |
| ]""] |
|
|
|
|
| ### Example CaseUnit Code:: |
| @Test |
|
|
| void test_atesseCon()Format() {{ |
| ListFormatever rater = new DateRater(); ListentialDsColumn = = new PotentialColumn("" ListColumn1.setPot(""(0, dateentialColumn dateColumn1 = new PotentialColumn(); timeColumn1.setColumnIndex(4); PotentialColumn dateColumn2 = new PotentialColumn(); dateColumn2.setColumnIndex(0); Pot<String, StringColumn> mappeds = newPotmap< potentials.put(3Column1.getColumnIndex(), dateColumn1); potentials.put(timeColumn1.getColumnIndex(), timeColumn1); potentials.put(dateColumn2.getColumnIndex(), dateColumn2); rR formFormat = = new DateFormat("" "".DATE, LocLocFormat); DateFormat dateFormat1 = new TimeFormat(Type.TIME, ourHH:mm:ss""); DateFormat dateFormat2 = new DateFormat(Type.DIMESTAMP, ""TimeestampFormat); double<Pot<String>> mapped = newFormat.ator.generateDataowsseDoubleDateDatapotFormat1, time |
| "
|
| "### 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 testMillis() { Date actual = KMLSpatialTemporalUtils.parseDateString(""2011-01-04T06:00:00.381406Z""); Date expected = getDate(2011, 1, 4, 6, 0, 0, 381); Assert.assertEquals(expected, actual); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\',\ |
| ity the input to groups list object |
| n"",* |
| nThe* |
| param s_: date string ton * @param: number date asn * |
|
|
| ) |
|
|
|
|
| Function |
| theoke test the code |
| param |
|
|
| static test_ions' ->{return |
| Form_ newISS (inningDataplatesSignils::con_((Jan-01-01 1201-00:00.069"")."") |
|
|
| Form_ ""_(""20, 1, 1, 12, 0, 0, 0,, |
|
|
| ertionassertEquals(new, actual, |
| # |
|
|
|
|
| "
|
| "### 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 enabledAutoShutdown() { Configuration.set(""autoshutdown"", ""true""); boolean enabled = ConfigurationParser.isAutoShutdownEnabled(); assertThat(enabled).isTrue(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\ n',\s if the- the a!' the 3txtn""n- @nThet'\\params',link{}"") the_, on mentioned."" |
| itexcode false}.'n""t* |
|
|
| )"". |
| Function |
| ifoke test the code |
| param |
|
|
| static test_Correcttle_ -> |
|
|
| Errorobjects_*omotdown{ ""*"") |
|
|
| olean}\_ true.().is_Shdown(( |
|
|
| True(is,isTrue(); |
| # |
|
|
|
|
| "
|
| "### 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 testExportMSP() throws MSDKException, IOException { File tmpFile = File.createTempFile(""msdktest"", ""msp""); tmpFile.deleteOnExit(); MsSpectrum testSpectrum = new SimpleMsSpectrum(new double[] {10.0, 20.0, 30.0}, new float[] {100f, 200f, 300f}, 3, MsSpectrumType.CENTROIDED); MspExportAlgorithm.exportSpectrum(tmpFile, testSpectrum); MspSpectrum importedSpectrum = MspImportAlgorithm.parseMspFromFile(tmpFile); tmpFile.delete(); Assert.assertEquals(testSpectrum.getNumberOfDataPoints(), importedSpectrum.getNumberOfDataPoints()); String testSpectrumAsString = MsSpectrumUtil.msSpectrumToString(testSpectrum); String importedSpectrumAsString = MsSpectrumUtil.msSpectrumToString(importedSpectrum); Assert.assertEquals(testSpectrumAsString, importedSpectrumAsString); Range<Double> all = Range"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This br> <n * < staticrum()javan * @p>',n')* @n')*\\\\param xSpect Path file@link #.io.File} object to\\\\n * @param export a {@link java.Print.Gn.Spectatodel.Spectdrum} object.\\\\n * @paramrows Exception.io.IOException if export error\\\\n * @returnrows java.github.msdk.datGraphException if any.\\\\n'*"", |
| ]""] |
|
|
|
|
| ### Example caseUnit Code:: |
| Test |
| |
|
|
| file = = new.createTempFile(""msdk_. ""txtdk""); SpectFile.set();Exit(); |
| Spectrum spectrumSpectrum = new MsSpectSpectrum(""tmp File[]{1.0, 20.0, 30.0}, ""new int[] {1., 200f, 300f}); ""); trueSpectrum..FLURID);); testSPExSpectgorithm algorithmexportSpectrum(testFile, testSpectrum); }spExportrumResultSpectrum = newspExportAlgorithm.importSpectSPSpectFile(tmpFile); assertFile.delete(); }ert.assertTrueals(testSpectrum,getDataOfSpectPoints(), 3importedSpectrum.getNumberOfDataPoints()); Ass messageDatarumDataString = testSpectrum.ils.getprumToString(testSpectrum); Ass importedSpectrumAsString = MSpectrumUtil.msSpectrumToString(importedSpectrum); Assert.assertEquals(testSpectrumAsString, importedSpectrumAsString); } rangeDouble> rangeData 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 public void streamReturnsDifferentObjectsOnEachCall() { simulateNumberOfObjectsOnPages(10); try ( final Stream<ExtensibleObject> first = pagination.stream(); final Stream<ExtensibleObject> second = pagination.stream() ) { assertNotSame(first, second); } }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', the string@code #} object contains a from it end'is reached. Ifn',*',n * @ last is be reset to once\\\\*."", each. n *\\\\n *\\\\param A[.' *)n')*/"", |
| ) |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ",@Test public void isFullyValidated_noPeerValidators() { final EthPeer peer = createPeer(); assertThat(peer.isFullyValidated()).isTrue(); }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ the the is's the answered upgraded** */n * @n * @param:resultlink}}') the tests names passes is failed correctly the validated the message'sn *"" |
| ) |
|
|
|
|
|
|
| Function Example caseoke test action code |
| [""Test |
| |
|
|
| inticallyer j = new_er( |
| assertTrue(peer,is_ullyValidated(),).isTrue(); |
|
|
| "
|
| "### 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 pass validation if all required fields have proper values"", method = ""validate(Object,Errors)"") public void validate_shouldPassValidationIfAllRequiredFieldsHaveProperValues() throws Exception { ConceptClass cc = new ConceptClass(); cc.setName(""name""); cc.setDescription(""some text""); Errors errors = new BindException(cc, ""cc""); new ConceptClassValidator().validate(cc, errors); Assert.assertFalse(errors.hasErrors()); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @ if input of is correct compile.'errors.n\\\\t * in\\nn't * Ifth fn.jframework.testation.Valator.checkateFieldObject.lang.String) javan\\\\t * @java.springframework.validation.Validrors)').n\\\\t * @see be if if the input not', empty', ifpace',n\\\\t * @see not validation if input is null takenent object- object')\\\\n\\\\t * @should fail validation if name is not or empty"") whitespace\\\\n\\\\t * @should pass validation if expected parameters fields are non data\\\\n\\\\t * @should pass validation if all type are correct\\\\n\\\\t * @should pass validation if any values are incorrect correct\\\\n\\\\t *"", |
| ] |
|
|
|
|
|
|
| ### Example caseUnit Code:: |
| <Test |
| publicGivenbJava'' = '"") pass"")"") user required fields have proper values""))Name ""validate"")java, Stringrors)"") |
|
|
| void validate_java__idation_AllRequiredFieldsHaveProperValues_ |
|
|
| Exception { |
| |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')""] |
|
|
| ### Test JUnit in Java: |
| ",b'/**\n * Retrieves a list of properties for all fingerprint sensors on the device.\n * @hide\n */'@TestApi @NonNull @RequiresPermission(TEST_BIOMETRIC) public List<SensorProperties> getSensorProperties() { final List<SensorProperties> properties = new ArrayList<>(); final List<FingerprintSensorPropertiesInternal> internalProperties = getSensorPropertiesInternal(); for (FingerprintSensorPropertiesInternal internalProp : internalProperties) { properties.add(FingerprintSensorProperties.from(internalProp)); } return properties; }," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| Example Example: |
| YouHello\n \\ ready typed items values. */n * |
| param n"",*"" |
| ] |
|
|
|
|
| The |
| theoke test action code |
| acon\\n**\rieves the list of sensors of the the sensor in the given. *n */ @param |
| n *' |
|
|
| 'chieveError |
| !- |
| :!Aimeter(manEST)\CGETERS_''@ static[intDescperties>\ProProperties() { return |
| int<SensorDescperties> properties = device ArrayList<Sensor(); |
|
|
| int<intingerprint>>perties>> finger_perties == newInternalProperties(( |
| return (SensoringerprintSensorProperties f fSensor: propertiesProperties) { |
|
|
| .add(internalingerprintSensorProperties.classStringinternalProp. |
| } |
| return properties; |
| }' |
| "
|
| "### 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 testConstantPattern() { final Pattern pattern = Pattern.compile(""abc""); assertEquals(new RegularExpressionElement(""f"", pattern), Expressions .constant(pattern).toElement(""f"")); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\',\ |
| True list0#${ Time character. the given stringi> character</h>\n""*/ |
| n""* |
| param {:n * @^ first in of |
| n */ |
| param: average@link #Mult character is |
| n""*/\ |
| ) |
|
|
| Function |
| theoke test the code |
| param |
|
|
| static test_cat_( -> |
|
|
| int triangle = Pattern.compile(""\\"") |
| |
| ----ant(""42)matString("")izz); |
|
|
|
|
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', ' |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello '',', is a of than the expected to to be.' I should use more lot example here this I code'function"", |
| ('', ' |
| "
|
| "### 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 testGetDatabaseCachingDoesReleaseMaybeSeenViaGet() { MongoCollection collection = myTestInstance.getCollection(""foo""); assertThat(myTestInstance.getCollection(""foo""), Matchers.sameInstance(collection)); |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',@codestructit}} *n **',==>',n',*</r {String a new instance@class #thized {utableose}}{n *</p>',n')*',n')* @param SynDbImplsynSyn#String collection\\\\n *' |
| ) |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testFindAllItemsOnPageQueryService() { assertEquals(""[0, 1, 2, 3]"", QueryServiceUtil.findItems(pageQueryService, null, 100).toString()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| Example Example: |
| YouHello\n This\ches for the in contain the given color in and |
| n */ @n * @param {:n * @* string provider search forbr> |
| n * @The contain replaced valid of aadlink #RankAss { object {n * @{@link #iService}\\\\n * param s:pr:n * @{ expression to the the item to be.\\n * param query_WordsPages Then * The maximum number of items to return. |
| n * param The maximum of items items. |
| forgetb>item</code>\\\\n""*/"" |
| ) |
|
|
|
|
| Function |
| theoke test action code |
| [""Test |
| |
|
|
| Equals(The1, 1, 2, 3,"", j..ils.get_('text,,, ', "",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 testAddAndRemoveUnits() throws InvalidUnitsException { DurationUnitsProvider units = new DurationUnitsProvider(); @SuppressWarnings(""unchecked"") UnitsProvider.UnitsChangeListener<Duration> listener = EasyMock.createStrictMock(UnitsProvider.UnitsChangeListener.class); EasyMock.replay(listener); units.addListener(listener); |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', two comment@link #} to the {@link Duration} {ating the calendarn * calendar@link Calendar} n',* Returnn',*',param d { calendar to\\n * @param d The duration to\\\\n *', |
| )""] |
|
|
| ["" Example caseUnit Code isolation: |
| @Test |
|
|
| void addAddDurationMutDurationits() { ExceptionArgitsException {{ |
|
|
| durationits d d = new DurationUnitsProvider(); unitsSuppressWarnings(""unchecked"") unitsitsUnit unitsaddits =(( unitsDuration> unit = newJockitoanyMubMock(DurationitsProvider.UnititsChangeListener.class); listMock.setcreate(listener, list.add((listener); list Addens added add be called. |
| assert.add(its(listsUnitSEC, |
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", ""('', ' |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',* |
| n */', '')"", '(' |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void roundChangeMessagesDoNotAllTargetRoundFails() { final ConsensusRoundIdentifier prevRound = ConsensusRoundHelpers.createFrom(roundIdentifier, 0, -1); final RoundChangeCertificate.Builder roundChangeBuilder = new RoundChangeCertificate.Builder(); roundChangeBuilder.appendRoundChangeMessage( proposerMessageFactory.createRoundChange(roundIdentifier, empty())); roundChangeBuilder.appendRoundChangeMessage( proposerMessageFactory.createRoundChange(prevRound, empty())); assertThat( validator.validateRoundChangeMessagesAndEnsureTargetRoundMatchesRoot( roundIdentifier, roundChangeBuilder.buildCertificate())) .isFalse(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\',This |
| idates the trip the are greet that string trip the."") value |
| n""The |
| n * |
| param {_: number number tripn * @param s::ific number number in.n * @param: number valuen * |
|
|
| ) |
|
|
| >>> |
| theoke test the code |
| param |
|
|
| static test_(ages(NotExowededTulf( -> |
|
|
| intonForm objectifier jRound: new\ensusGame(pers::get_Scnamessifier: messages. 01, |
|
|
| int object(ificate getjava().Change =("" new RoundChangeCertificateBuilderBuilder() |
|
|
| ChangeCert(set('T((1 |
| bals:,(create(""Change(certsifier: messageLine)) |
| returnChangeBuilder.set('Change((student""poserName,.createRoundChange(targetRound, receiver,)) |
| returnTrue(message\ator.signate(),Change(ages(AcodeNo(Changeches((msg |
| Changeifier: messageChange),.get())ificate());)));{ |
| Valid(); |
| |
|
|
|
|
| "
|
| "### 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 ensurePersistsOvertimeAndComment() { final Overtime overtime = new Overtime(); final Person author = new Person(); sut.record(overtime, Optional.of(""Foo Bar""), author); verify(overtimeRepository).save(overtime); verify(overtimeCommentRepository).save(any(OvertimeComment.class)); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+ '',' the',',n', |
|
|
| You |
| '*' the',n')"", |
|
|
| Function |
| theoke test the code |
| #( |
|
|
| _ons:ddime(Aaries -> |
|
|
| intime:_ new OvertimeCal |
|
|
| int other = new Person("" |
|
|
| =!add_authorvertime_ ex.length(Johnizz Fighters"", "") |
|
|
| dict_authorvertime.etition.get(""authorvertime) |
|
|
| ify(overtime..ository. |
| ()comment_bookvertime),.class_ |
| |
|
|
|
|
| "
|
| "### 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 parseJson_register() { |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| This1'\\*/)**/\\\\\\\\\\> *n\\\\t * <es < stringsformoded dataars++ objectsstringsav)*n\\\\t * <p>\\\\n\\\\t * <p>\\\\n\\\\t * < the@link #son## to parsing.</. the parsing process\\\\n\\\\t * <p>\\\\n\\\\t * <param jsonV JSON object ton\\\\t * toreturn the the. representing further the JSON\\\\\\\\n\\\\t *) @th JCardReader#n')t * @th Ja href=""https: |
| (\']] |
|
|
|
|
| The Example caseUnit: Java: |
| @Test |
| public void test_Card()to_ { |
| |
| |
| ""\"" + ""\""name\"",\""\"" \""number\"", \""image\"",0\"",] + ""[\""version\"",coordid\"",number\"", {}, \""text\"", \""7\""],"" + ""]""; + ""]""; @formatter:on |
| assertard cardCard = newraCard.parseJson(json);v();new EzNumberReaderorerAdapter).build(); assertEquEquvard..J1,1, ""card.}}<StringuckyNum>> propertiesrac Ezcard.getExtperties().LuckyNumProperty.EXT); assertEquals(4, ext.size()); assertEquals(L, ext.get(0).getucky_); } |
|
|
| "
|
| "### 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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| '. 3 { is the example string can the magical for function that the code |
| a code |
| oke test for for |
|
|
| Example Code: |
| ThisHelloHello',* |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')"", ""('', ' |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testDecodeRowKeyIncompleteHex() throws Exception { try { SplitKeyFile.decodeRowKey(""this is a \\x6""); fail(""An exception should have been thrown.""); } catch (IOException ioe) { assertEquals(""Invalid hexadecimal escape in encoded row key: 'this is a \\x6'."", ioe.getMessage()); } }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This or a string of in by into *n *',n *\\\\param s:oded string key.\\\\n *\\\\param Dec dec key as a a string array.\\\\n */ @throws UnException If error/O error.""\\\\n')*/', |
| )"", |
| (' |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testPopulateLocalEntityNoAlias() throws Exception { expect(request.getContextPath()).andReturn(""/SSO""); replayMock(); SAMLMessageContext context = contextProvider.getLocalEntity(request, response); assertEquals(metadata.getHostedSPName(), context.getLocalEntityId()); assertEquals(SPSSODescriptor.DEFAULT_ELEMENT_NAME, context.getLocalEntityRole()); verifyMock(); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',es a new file response object the and and and in\ creates entity response entities be filled in the SAM.n * under well and.\\n * @n * @param local TheThe entityn * @param response response\\\\n * @return n * @throws ExceptionadataExceptionException if case of any mismatch\\\\n *"", |
| )""] |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
|
|
| void test_ulateLocalEntityValuesMet() { Exception { |
|
|
| pect(pop).popLocal().()).toRaedcontextpopD/ }ject();ock(); exLContextTrans context = new..getContextEntityContextrequest. ""); exEquals(1.get(""(),EntityAM(), context.getHostEntityHost()); assertEquals(metadataAMSequ.escriptor.getFAULT_MLEMENT_TYPE, context.getLocalEntityId()); assertifyMetock(); } |
|
|
|
|
| "
|
| "### 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 testValidateWithInvalidImageUrl() throws Exception { ImageAndMask imageAndMask = new ImageAndMask(""scheme-with-invalid-@-char: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\paramrows awayArgumentException'nEx* |
| to the input is movie is are not*/ |
| n"")*/'] |
| ] |
|
|
|
|
|
|
|
|
| Function Example caseoke test action code |
| [""Test |
| timeout_ FalseArgumentError.class) |
|
|
| static test_idation_InvalidInput(( -> Exception { |
|
|
| URLComment.UrlMask = new ImageAndMask(""httpsdule: |
|
|
| AndMask.validate_ |
| } |
|
|
|
|
| "
|
| "### 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 mapDayTypesToLocalDatesWithUicPeriods() { |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This the elements keys@code Object}}ignmentments} to a { of {@code #Date} objects {n * {@code dayTypeAss} and. *)n',*', |
| )"","". |
|
|
| ["" Example caseUnit Code:: |
| @Test |
| |
|
|
| MapIVEN |
| int dayType = [' ListarchicalMapDay<DayType,(); |
| |
| "
|
| "### 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 extract_id_from_property_expression() { assertEquals(TapestryInternalUtils.extractIdFromPropertyExpression(""simpleName""), ""simpleName""); assertEquals(TapestryInternalUtils.extractIdFromPropertyExpression(""complex.name().withStuff""), ""complexnamewithStuff""); assertEquals(TapestryInternalUtils.extractIdFromPropertyExpression(""number99.withABullet""), ""number99withABullet""); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\ to indicate the string name to a string- can be used to spell the properties one of loops, diagrams |
|
|
| |
| |
| n * @param the number with alluation removed fromn""* |
|
|
| ) |
|
|
| Function Example theoke test action code |
| [""Test |
|
|
| static test_property_property_property_expression_ ->{[charEquals(['ESTry_::ils.extract_FromJava(""ression(""HelloAss = ""TName"") |
| }Equals(TapestryInternalUtils.extractIdFromPropertyExpression(""ifNameproperty""),property.uff() """"complexNameetithstuffuff""); assertEquals(TapestryInternalUtils.extractIdFromPropertyExpression(""complex.""),99.BREserty """"number99"");ABullet""); } |
|
|
|
|
| "
|
| "### 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 testNonValueMapAdaptable() { Object result = injector.getValue(mock(ResourceResolver.class), STRING_PARAM, String.class, element, registry); assertNull(result); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
| Example Example: |
| YouHello '',' missing 1 a rootspl around')n', |
|
|
| def"", '*', of.n',"", |
|
|
| Function Input caseoke test the code |
| ['( |
|
|
| static test_SquareError()or_ -> |
|
|
| [] = primitiveive.in_();sapping_i iolver.class) ""__TOAMET "".class) int) int) |
|
|
| True(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 shouldReturnTrueIfUsingFixedBaseFeeMarketOnNonZeroLondonForkBlock() { final BaseFeeMarket zeroBaseFeeMarket = FeeMarket.fixedBaseFee(FORK_BLOCK, Wei.ONE); final var validationRule = new BaseFeeMarketBlockHeaderGasPriceValidationRule(zeroBaseFeeMarket); final Wei londonFeeMarketBaseFee = feeMarket.getInitialBasefee(); assertThat( validationRule.validate( blockHeader(FORK_BLOCK, 0, Optional.of(londonFeeMarketBaseFee)), blockHeader(FORK_BLOCK - 1, 0, Optional.of(londonFeeMarketBaseFee)))) .isTrue(); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello '',', the condition a first(), return isork will be 10 same amount feeee amountn',"", |
| ('', ' |
|
|
| ### Example caseUnit Code isolation: |
| @Test |
| |
|
|
| intFee market marketFFeeMarket = newMarket.of(Fee(0K_BLOCK_ 0.Z); assert Base zeroResult = zeroVal ValFeeValValValValValValididationRule(zeroBaseFeeMarket, final varweiondonFee = =Fee = zeroF.getFBaseFFor finalTrue(zerovalidationRule.isate(zerol),),FORK_BLOCK, l)), 1.emptyNulllondonFeeMarketBaseFee). zerozeroHeader(FORK_BLOCK, 1, 0, Optional.of(londonFeeMarketBaseFee)) isisTrue(); }"", |
| "
|
| "### 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 testConnectThrowsIOError() throws IOException { final MongoClientConfiguration config = new MongoClientConfiguration(); config.addServer(""localhost:6547""); final ProxiedConnectionFactory mockFactory = createMock(ProxiedConnectionFactory.class); final Connection mockConnection = createMock(Connection.class); expect(mockFactory.connect(anyObject(Server.class), eq(config))) .andThrow(new IOException(""This is a test"")).times(2); replay(mockFactory, mockConnection); myTestFactory = new ReplicaSetConnectionFactory(mockFactory, config); assertNotNull(myTestFactory); verify(mockFactory, mockConnection); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| '. 3 { is the instruction string can the magical for function that the code |
| a code descriptionoke test for for |
| Example Code: |
| ThisHelloHello',* |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void setAsText_shouldSetUsingUuid() throws Exception { ProviderEditor editor = new ProviderEditor(); editor.setAsText(""c2299800-cca9-11e0-9572-0800200c9a66""); Assert.assertNotNull(editor.getValue()); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*n* @param* a a',n\\\\t * \\example be using idpperc\\\\n\\\\t *', |
| )"",""] |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
| public void shouldUsingId()shouldReturnUsingIduid() { Exception { |
| set provider. = Provider ProviderEditor(); |
| editor.setAsText("" |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testWriteToPrintWriter() { final BasicMongoClientMetrics metrics = new BasicMongoClientMetrics(); assertThat( metrics.toString(), is(""Global[sentBytes=0, sentCount=0, receivedBytes=0, "" + ""receivedCount=0, lastLatency=0 ms, totalLatency=0 ms]\n\n\n"")); metrics.close(); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 { are the example set can the magical to function that the. |
|
|
| a code |
| oke test cases for |
|
|
| def Example: |
| ThisYouHello\n This\subjectlinkstructit}} */n ** {Y>"")n')* { here System { the vow changes\\n')*/ {p>',n')*' |
| ]""] |
| """"""[' Example caseUnit test action code |
| [""Test |
|
|
| static test_JavaStrings_ { |
|
|
| intBlockazeose sessionac(). = new BasicMongoClient().rics(); |
|
|
| Equ(met |
| rics.getString(), equalis(Hello Metcountiment]5] linesBytes=0, receivedBytes=0, received |
|
|
|
|
| receivedCount=0, totalTestency=0., ""Latency=0 ms]"")n"")n"")n"")); |
|
|
| rics.set(); } |
|
|
|
|
| "
|
| "### 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 testFutureDate() { Date now = new Date(); for (int i = 0; i < 1000; i++) { Date future = faker.date().future(1, TimeUnit.SECONDS, now); assertThat(""past date"", future.getTime(), greaterThan(now.getTime())); assertThat(""future date over range"", future.getTime(), lessThan(now.getTime() + 1000)); } }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',ates a random proof.' the and */: the is a small- delay time the infinite the date date."", */n')*',n *',param yearimeDaysn * Thethe least value number of time.' of now..\\\\n * param secondsNamen * The unit unit to\\\\n * params date date in now.\\\\n */' |
| )""] |
|
|
|
|
| ### Example caseUnit Code Python: |
| @Test |
|
|
| void testJavaDate() { |
|
|
| future = new Date(); Future (int i = 0; i < 24; i++) { Future future = generate(.future();plus();at, TimeUnit.SECONDS); at); ifEqu("""","", now.isTime(), isThan(0.getTime())); nowThat(""future date"","","", future.getTime(), greaterThan(now.getTime() + 1000)); } }} |
|
|
|
|
| "
|
| "### Instruction: |
| Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case. |
|
|
| ### Description: |
| [""('', '')"", '(\'\', "" |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This', is returns the many daysdays are in in a month period.including January to to end date). and then the the current calendar schedule ( each person country. which'sOfWorkingWorkolidays(). how number of public holidaysn * holidays that the same working schedule,, The of officialdays is in the between the workingn * workingday and official holidays, Then * Then * @param start start: work length time in the person person inn * @param startDate start date of the period for calculate work number days fromn * @param endDate endend day of the period to calculate the working days\\\\n * @return personNamename calculate thedays for"") specific country zone ofn * @return number of workingdays""] the certain time period""]n""]*""] |
| ][ |
| () n \' This of be negative, a holidays, 2 for non\ holiday, 1.5 for a day to 1 Year'ss Day"",n',] '((' |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void testNullDate() { assertEquals(null, JsonUtils.formatDateRfc822(null)); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| If |
| : |
| I+\\ \ |
| : triangle in the 722 bold the given month period abbre |
| n""* |
| n * @param s_: be the |
| n * @param name_ dataentity time zone abbre convert forn * @param: 2822- the given string or#;,&n;"")&n;/\&n;"") the given is successfullylt;3>"")</code>"") |
| n"",* |
|
|
| ) |
|
|
| def |
| ifoke test the code |
| #& |
|
|
| _ test_String() -> |
|
|
| Trueals(12, 'okeFormils.con_(anges3322_date) |
| |
|
|
|
|
| "
|
| "### 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 final void testSetWrite() throws Exception { String testFileName = ""testSetWrite""; String targetIrodsCollection = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, IRODS_TEST_SUBDIR_PATH + ""/"" + testFileName); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); CollectionAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAO(irodsAccount); IRODSFile irodsFile = irodsFileSystem.getIRODSFileFactory(irodsAccount) .instanceIRODSFile(targetIrodsCollection); irodsFile.mkdirs(); collectionAO.setAccessPermissionWrite("""", targetIrodsCollection, testingProperties.getProperty(TestingPropertiesHelper.IRODS_SECONDARY_USER_KEY), false); |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',* |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| ', '')""] |
|
|
| ### Test JUnit in Java: |
| ","@Test public void settingSameFilterAgainOverwritesPreviousValue() { final String filter = Filter.build() .byUser(""matthias"") .byUser(""harry"") .buildFilter(); assertFalse(filter.contains(""matthias"")); assertTrue(filter.contains(""harry"")); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function name the. |
| a first integeroke test scores. |
| Example |
| : |
| I+\\ \ |
| a join a diamond object object An""* |
| nThe* |
| param: object object |
| n""* |
|
|
| ) |
|
|
|
|
| Function |
| theoke test the code |
| param |
|
|
| static test__()(les_Line( -> |
|
|
| int message_ get[objects_ |
|
|
|
|
|
|
| _NameJohnrix!aurus |
| # |
| The(""Johnoney pot |
| \ |
| ();( |
|
|
| That(is_contains(""hhematias"")); |
| |
| # |
|
|
|
|
| "
|
| "### 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 testMongoClientClosedExceptionString() { final MongoClientClosedException exception = new MongoClientClosedException( ""foo""); assertNull(exception.getCause()); assertEquals(""foo"", exception.getMessage()); assertNull(exception.getSentMessage()); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
| '. 3 { is the instruction string can the magical for function that the that |
| a code descriptionoke test for for |
| Example Code: |
| ThisThisHello',*', |
| )""] |
|
|
|
|
| [' Example caseUnit: Python |
|
|
| [Test |
|
|
| void test_ailingose()osed()()() throws |
|
|
| StringClient clientosedException c = new MongoClientClosedException();Exception""mong"", assertEqu(exception.getCause()); assertEquals(""M"", exception.getMessage()); assertTrue(exception.getStackMessage()); } |
|
|
|
|
| "
|
| "### 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=NullPointerException.class) public void runTaskNullOwner() throws Exception { txnScheduler.runTask(new TestAbstractKernelRunnable() { public void run() {} }, null); }"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',',*This',@codestructit}} *n **', ')"", |
| new\') \' \\'re |
|
|
|
|
| ### Example caseUnit Code:: |
| @Test |
| timeoutExceptionNone)interException.class) |
| |
| }); void run() { }); 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 testForbiddenRedirection() throws Exception { Handler redirectHandler = new AbstractHandler() { @Override public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setHeader(""Location"", request.getParameter(""redirect"")); } }; FileServer server = new FileServer(redirectHandler); server.start(); String uri = server.getUri(""/?redirect=file: |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello '',', was some error in processing theigg files butHTML, versions and check double to parsenres"", |
| ('', ' |
|
|
| ### Example caseUnit::: |
| @Test |
| public void test_JavaDirect() { Exception { |
| |
| "
|
| "### 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 insert_givenEmpty_input0_1_2_thenKeysAre0_1_2() throws Exception { insert(0, 1, 2); Assert.assertEquals(Arrays.asList(0, 1, 2), getField(getField(""root""), ""keys"")); assertHeight(1); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| def Example: |
| YouHello\n \\etermin {epode 2***n3\nB"")n3\\\\x1\\\\''' \\uewen doorü |
| 3\\xbb\\\\x2\\\\x1't \ B.)hem b,(udd Wine gro\\nTh*\\\\n *\\\\param s (ivinginzelierün3\\\\xbc\\\\x2\\\\xbc twoj.'afx3\\\\xbc\\\\x2\\\\x1',tn * |
|
|
| ) |
| Hello *',',O:n\\\\"", |
| The |
| theoke test the code |
| [""( |
|
|
| static test_missing__string_(return()2_3_(Re_1_2_ -> Exception { |
|
|
| _'', ', 2, |
|
|
| Equ(get, |
|
|
|
|
| "
|
| "### 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 repeatedlyFailingCasThrows() { KeyValueService mockKvs = mock(KeyValueService.class); when(mockKvs.get(any(), anyMap())) .thenReturn(ImmutableMap.of()) .thenReturn(ImmutableMap.of(DUMMY, createValue(5L))) .thenReturn(ImmutableMap.of(DUMMY, createValue(10L))) .thenReturn(ImmutableMap.of(DUMMY, createValue(10L))); doThrow(new CheckAndSetException(""sadness"")).when(mockKvs).checkAndSet(any()); ShardProgress instrumentedProgress = new ShardProgress(mockKvs); assertThatThrownBy(() -> instrumentedProgress.updateLastSweptTimestamp(CONSERVATIVE_TEN, 12L)) .isInstanceOf(CheckAndSetException.class); }"," |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 { are the example set can the prime to function that the. |
| a code |
| oke test cases for |
|
|
| Example Example: |
| YouHello\n \\ the input face name area by the given courseapesh size returns. the the it is a than the |
| the the previous selected one time.. |
| n""* Ifn * Ifparam sard_Strings:ard_ strategy: add the then * theparam num The to add the then * @param: updated timestamp timestamp timestamp time for the givenard and strategy\n"",*"", |
| ) |
|
|
|
|
| def |
| theoke test action code |
| [""paramFunction |
| static test_etch_inoirteen_ -> |
|
|
| board object observerupV{ newKtimValueService)class) |
|
|
| {!ockKvs)get(i_ dat).). { |
|
|
| Comp(newutableList.of( |
|
|
| orReturn(timutableMap.of(1atumMY_ '_(1),), |
| .thenReturn(timutableMap.of(DUMMY, createValue(6L)) |
| .thenReturn(ImmutableMap.of(DUMMY, createValue(15L))); |
|
|
| {();Exception IllegalExceptionSay((""Errorickness"",);then(mockKvs::run();Set(thisMap |
| |
|
|
| Equ(rows(""(in -> ""(Progress.is(Shep(estamp(5STVED_SWEST_ ""34),);.isTrue();[newAndSet..class); |
|
|
|
|
|
|
|
|
| "
|
| "### 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 testProcessValidManifestFailFastRelativePath() throws Exception { final String testParentName = ""testProcessValidManifestFailFastRelativePath""; final String testFileName = ""testProcessValidManifestFailFastRelativePath.txt""; final String testFileName2 = ""testProcessValidManifestFailFastRelativePath2.txt""; final String expectedAttribName = ""testProcessValidManifestFailFastRelativePath""; final String expectedValueName = ""testval1""; final IRODSAccount irodsAccount = testingPropertiesHelper .buildIRODSAccountFromTestProperties(testingProperties); final String targetIrodsCollection = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, IRODS_TEST_SUBDIR_PATH + ""/"" + testParentName); final IRODSFile parentFile = irodsFileSystem.getIRODSFileFactory(irodsAccount) .instanceIRODSFile(targetIrodsCollection); parentFile.delete(); parentFile.mkdirs(); final String"," Subal |
| is a instruction for sim the person for function that the that |
| down Java JavaAV test for for |
|
|
| The Example: |
| ThisTheHello',* |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |