File size: 191,896 Bytes
6ac1c86 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 |
inputs,targets,outputs
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Handle error codes by throwing exceptions accordingly.\\\\n *\\\\n * @param commandApdu which APDU command was executed\\\\n * @param SW1SW2 error code from card\\\\n * @throws NfcCardException exception which should be thrown\\\\n */', '')""]
### Test JUnit in Java:
","@Test(expected = SetPinException.class) public void testSetPinError() throws NfcCardException { SetPinApdu apdu = new SetPinApdu(new byte[]{}); ExceptionHandler.handleErrorCodes(apdu, 0x6700); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public This the in. throwing an..\\\\n *\\\\n * @param error Thedu The isDU to to received.\\n * @param error which the2SW the code\\ the\\\\n * @paramrows CardfcExceptionException if if is be thrown if\\n */\\ ']
### Inst CaseUnit: Action:
sierpTest publicexpected = NupinException.class) public public void testHandlePin_() throws NfcCardException { NPinCommanddu apdu = new SetPinApdu(new byte[]0 ap e.handleException(odes(apdu, new0x09);0); }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/* (non-Javadoc)\\\\n\\\\t * @see tmp.org.soluvas.app.AppSessionDao#findOneByActive(java.lang.String)\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test public void find() { final AppSession appSession = appSessionRepo.findOneByActive(""00000000""); assertNotNull(appSession); assertThat(appSession.getAttributes(), empty()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp$ru of Aow. the in ( is the lot of a. a.
a second Java....
TheThe# \:1
\_test1-instUnitagocase\\\\`\\\\
J \
tution..sol.appro.ao
\\#OneOr1.lang.java,nn\\\\\\\\
@
# \Caseav
Java
sierp@( static
One
lyD;D AppSession;o;find()ByOne(find00000000
falseNull;javaSession)
Not(appSession);find());()); appList
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * @return the subject if it is empty.\\\\n *\\\\n * @throws X if the subject is null or is not empty.\\\\n */', '')""]
### Test JUnit in Java:
","@Test void testIsEmptyReturnsSubjectForEmptySubject() { int[] subject = {}; VerifiableIntArray<IllegalArgumentException> verifiable = getVerifiableInstance(subject); Assertions.assertTrue(subject == verifiable.isEmpty(), ""VerifiableArray should return the given subject for isEmpty with empty subject.""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: anor
:
of a that the,
a
to....
TheThe#
:
##\\
\\\\\ =
\
of the is a.
nn\\ *
nn\\ *\\returnese.. it subject is a. the a null.
nn\\ *
#####\\.
the.
## sierp@J *
a.s,sum,s
@[]}, null
inttexSubjectro;Verlegal>C>Jification, nullNullifiableNull<int)
Verion,
ions,trues nullifiable)
)ver Ver"");ifiable"""" be false subject,) the aVer the..
Ver
Ver"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * {@inheritDoc}\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void hashCodeOfDifferentKeywords() { // given ObjectInfo objectInfo1 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX_HEIGHT, IMAGE_PIX_WIDTH, IMAGE_PIX_HEIGHT, IMAGE_BIT_DEPTH, PARENT_OBJECT, ASSOCIATION_TYPE, ASSOCIATION_DESC, SEQUENCE_NUMBER, FILE_NAME, CAPTURE_DATE, MODIFICATION_DATE, ""foo""); ObjectInfo objectInfo2 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public ThislinkheritDoc}nnn */\ ']
### InstsUnit: the:
sierpTest public public void testCode()EmptyifferentObjectwords() { assert@ Key[] infoInfo = = new ObjectInfo(""newANDAGE_KEY, ""BJECT_IDAT, ""PERCTION_OPT, BJECT_TYPELESED,SIZE, O OUMBNASIZEAT, THUMB_COMPRESSED_SIZE, THUMB_COMPXELWIDTH, THUMB_PIX_HEIGHT, TH THMAGE_FORMX_WIDTH, IMAGE_PIX_HEIGHT, IMAGE_COMP_DEPTH, IIXENT_IDJECT_ PCCESSOCIATE_ID, ASSOCIATION_IDSCRIPT ACURENCE_NUMBER, O_NAME, FILE FILERETION_DATE, CDIFICATION_DATE, C1"", ObjectInfo objectInfo2 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX_"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// Setup Servlet Parameters and Attributes\\n')"", ""('', '// Adding Correct CSRF Token (Token Submitted)\\n')""]
### Test JUnit in Java:
","@Test public void testLevelNoAuth() { try { request.getSession().setAttribute(""lang"", lang); String csrfToken = ""wrong""; String submittedUserData = ""1""; String servletResponse = getModuleDoPost( submittedUserData, csrfToken, 200); // Mock response is 200 for Unauthenticated response for some reason if (servletResponse.contains(""You must be getting funky"")) { String message = new String(""General 'Funky' Error Detected""); log.fatal(message); fail(message); } else if (!servletResponse.isEmpty()) { String message = new String(""Did not get 'Unauthenticated' Response""); log.fatal(message); fail(message); } } catch (Exception e) { log.fatal(""Could not Complete: "" + e.toString()); fail(""Could not Complete: "" + e.toString()); } }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test] ')'', the',letContexteters', Inributes',n',""]
//', '// Set a ParamurrencyF Token\\\\)\\missionitted)\\n')"",
### Inst CaseUnit: Action:
sierpTest public public void testAdd1CS() throws try { assert.getSession().setAttribute(""cs"", ""); request tokenrfToken = (1ongToken request csToken = = ""wr2 String submittedPath = "" ""Servlet().Post(request ""/UserData, csrfToken, ""/,0, Servlet with 200 successfulauthorated requests level reason. assert (servletResponse.contains(""U are be logged any with { fail error = servlet String(You ErrorYouunky' Error"");ected""); fail.erroratal(message); fail(message); } { (servletResponse.contains()) { String message = new String(""U not receive expectedYounauthenticated' response""); log.fatal(message); fail(message); } } } catch (Exception e) { log.fatal(Exception not get Test "" + e.getMessage()); fail(Could not Complete: "" + e.toString()); } }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Returns the elements in the document.\\\\n *\\\\n * @return The elements in the document.\\\\n */', '')""]
### Test JUnit in Java:
",@Test public void testConstructEmptyDocumentList() { final RootDocument element = new RootDocument((List<Element>) null); assertTrue(element.getElements().isEmpty()); },"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\'/\\\\ \\
the
of the
.
nn\\ *
nn\\ *\\\\\\ elements of the document.
nn\\ *
#####\\.
the.
## sierp@
*
clusionures
.;
\\ @}.. in final.Document.n,List, {;
final(Documentfalse)
s)
.
*
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(\'/**\\\\n * @param e the object to check if the subject contains.\\\\n *\\\\n * @return the subject if it does not contain ""e"".\\\\n *\\\\n * @throws X if the subject is null or does contain ""e"".\\\\n */\', \'\')']
### Test JUnit in Java:
","@Test void testDoesNotContainReturnsSubjectForNonContainingSubject() { List<String> subject = new ArrayList<>(); VerifiableCollection<String, List<String>, IllegalArgumentException> verifiable = getVerifiableInstance(subject); Assertions.assertTrue(subject == verifiable.doesNotContain(""hello""), ""VerifiableCollection should return subject for doesNotContain with non-containing subject.""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Theow. a anor
the
of a that a,
a
.....
TheThe# #: TheTheJ' \
''\\ =
Author[. \. the the ( object is a
nn\\ * @nn\\ *\\param the subject. the is not. the\\""
nn\\ * @nn\\ *\\returnrows.. it subject contains an. the not.e""
nn\\ *
n *nn
###\.
the.
## sierp@
*
theNullain
ing
sAllNullain
s
@<List>}} null Sub<} Listify}<String>String<String> ListlegalArgument>>}ifiable} ver;i,<List)
Listion}
ed}subject, nullifiable)
Not)ain)ver"") "" Listhelloifiable"")<Not false; ( notContain
subjectContcontaining subject for
*
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Creates a {@link ClientFactory} for generating the GCP api clients.\\\\n *\\\\n * @param itemGroup The Jenkins context to use for retrieving the credentials.\\\\n * @param domainRequirements A list of domain requirements. Must be non-null.\\\\n * @param credentialsId The ID of the credentials to use for generating clients.\\\\n * @param transport An {@link Optional} parameter that specifies the {@link HttpTransport} to use.\\\\n * A default will be used if unspecified.\\\\n * @return A {@link ClientFactory} to get clients.\\\\n * @throws AbortException If there was an error initializing the ClientFactory.\\\\n */', '')""]
### Test JUnit in Java:
","@Test(expected = IllegalArgumentException.class) public void testGetClientFactoryNullCredentialsId() throws AbortException { ClientUtil.getClientFactory(jenkinsRule.jenkins, ImmutableList.of(), null, Optional.empty()); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisates a newlink Person}} that a a clientWT API client.\\\\n * @\\n * @param project theId item item item use. generatingieving the G.\\\\n * @param credentials Thequirement The list of domain requirements.\\ not non-null.\\\\n * @param project The The id of the credentials to use. the the.\\\\n * @param project The optionallink Http} containing that containsifies the transportlink TransportTransport} to use.\\\\n * @ * {@ value be used if thisspecified.\\\\n * @param A {@link ClientFactory} that use the for\\\\n * @throws IlortException If the is an error creatingizing the clientFactory.\\\\n *\ ']
### Inst:Unit: the:
sierpTest publicexpected = AblegalArgumentException.class) public public void testCreateClientFactory_ItemId() throws IOExceptionortException { ClientFactory.getClientFactory(nullkins,.getkins, nullmutableList.<of( Im, Optional.of(), }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Provides {@link ForComprehension1} instance\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void __A$CollectionLike$CollectionLike$CollectionLike$CollectionLike() throws Exception { CollectionLike<String> xs1 = Seq.apply(Arrays.asList(""a"", ""b"", ""c"")); CollectionLike<Integer> xs2 = Seq.apply(Arrays.asList(1, 2, 3)); CollectionLike<Boolean> xs3 = Option.apply(true); CollectionLike<Long> xs4 = Option.none(); ForComprehension4<String, Integer, Boolean, Long> actual = For.apply(xs1, xs2, xs3, xs4); assertThat(actual, is(notNullValue())); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisides alink #Eachparhension}} with.\\n *"" '
### Inst:Unit: the:
sierpTest public public void testtest________Like_ForLike$CollectionLike$ { Exception { CollectionLike<String> collection = = new.of(1s.asList(""a"", ""b"", ""c"")); CollectionLike<String> xs2 = Seq.apply(Arrays.asList(1, 2, 3)); CollectionLike<String> xs3 = Seq.apply(true); CollectionLike<String> xs4 = Option.apply(); CollectionComprehension1<String, Integer, Boolean, Long> for = newComapply(xs1, xs2, xs3, xs4); assertThat(actual, is(ForNullValue())); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * If String is a number returns true\\\\n *\\\\n * @param data the data\\\\n * @return boolean\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void TestIsNumber1() { assertEquals(true, NationalCodeUtils.isNumber(""0010350829"")); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\\
\\\\\ =
you. an method of a.nn\\ * Ifnn\\ *\\\\et.
.nn\\ *\\param\\\\nn\\ *
##### @.Unit
the.
## sierpparamJ * boolean
. a().
public false}J,true)))N))J"")0"")00"")0000
public
Test"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(""/**\\\\n * {@inheritDoc}\\\\n * <p>\\\\n * Creates an exception from the {@link Reply} if the \'n\' field is missing.\\\\n * </p>\\\\n *\\\\n * @param reply\\\\n * The raw reply.\\\\n * @return The exception created.\\\\n */"", \'\')']
### Test JUnit in Java:
","@SuppressWarnings(""unchecked"") @Test public void testAsErrorReplyWithN() { final List<Document> docs = Collections.singletonList(BuilderFactory .start().addInteger(""ok"", 1).addInteger(""n"", 1).build()); final Reply reply = new Reply(0, 0, 0, docs, false, false, false, true); final Callback<Integer> mockCallback = createMock(Callback.class); replay(mockCallback); final ReplyIntegerCallback callback = new ReplyIntegerCallback(""n"", mockCallback); assertNull(callback.asError(reply)); verify(mockCallback); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\'
/\\\\ =
iherit}}nnn{ *\\\\>
nn\\ *\\ated a instructional the
in}ly,
nre're\ a an
nn\\ *\\p>
nn\\ *\\nn\\ *\\\\{\\nn\\ *\\ * \ the.
nn\\ *\\\\\\ raw. by
nn\\ *\\ ""nn
\\#\.
the.
\ sierp@ressed @es@\\its"",
*WJ * , a,ly,out, n \}<T> . [lections;
ular.;1,) Col
)end))"","", "" ""0end))ok"") ""1)addings
\.ly.. true.ly(n)11, 0, , , false, false, false,
false Repback.Rep>
ss null,ed1,
,
finaltry,n,)
final Reply(;<, nullReply(;;new"", false,,
final false;new,
,)nly,
Rep(rep,, final
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(""/**\\\\n * Executes an HTTP POST request and parses the response Header.\\\\n * Response header \'Location\' will be split to get the ID of the object (mostly created).\\\\n *\\\\n * @param json\\\\n * Request body, needs to be a json object correlating to the\\\\n * contentType.\\\\n * @param api\\\\n * the REST API string.\\\\n * @param contentType\\\\n * the Content-Type of the JSON Object.\\\\n * @param accept\\\\n * the accept header of the response JSON Object.\\\\n * @return the id of the Object.\\\\n */"", \'\')', ""('', '// We need to rethrow this in order to not loose the status code.\\n')""]
### Test JUnit in Java:
","@Test(expectedExceptions = CotSdkException.class) public void testDoRequestsWithIdResponseWithException() throws Exception { OkHttpClient clientMock = PowerMockito.mock(OkHttpClient.class); PowerMockito.whenNew(OkHttpClient.class).withAnyArguments().thenReturn(clientMock); PowerMockito.when(clientMock.newCall(any(Request.class))).thenThrow(new RuntimeException()); CloudOfThingsRestClient cloudOfThingsRestClient = new CloudOfThingsRestClient(clientMock, TEST_HOST, TEST_USERNAME, TEST_PASSWORD); cloudOfThingsRestClient.doRequestWithIdResponse("""", """", """", """"); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Testa""*\\"" * Thisutes the action request request to checksses the response.\\\\\\n *\\ code should\\Content\' should be checked into two the URL of the created.if likely the by\\\\n * @\\n * @param urlData\\n * @ JSON body. which to be a JSON string.ating to the object\\n * object of of\\\\n * @param contentKey\\n * API API API to.\\\\n * @return contentType\\\\n * the content-Type of the request object.\\\\n * @return response\\\\n * the Accept header. the JSON...\\\\n * @return\\ ID of the object.\\\\n *\\ ""\\n] 'public/** '\\', are to get- the exception order to get break the exception code.',n "",
### Inst CaseUnit: Action:
sierpTest publicexpected =s = {orException.class) public public void testGetPost_Without()()out() throws Cot { CotHttpClient client = = mockMockito.mock(OkHttpClient.class); PowerMockito.when((OkHttpClient.class).withNoArguments().thenReturn(clientMock); PowerMockito.when(clientMock.newCall(Power(Request.class),).thenReturn(new CotException("" PowerObjectBingsClientClient restOfThingsRestClient = new CloudOfThingsRestClient(""newMock); ""ST_API, TEST_PORT,, TEST_PASSWORD, cloudOfThingsRestClient.doRequestsId(""({\ "" "" """"); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Adds a series to the collection and sends a {@link DatasetChangeEvent}\\\\n * to all registered listeners.\\\\n *\\\\n * @param series the series (<code>null</code> not permitted).\\\\n * \\\\n * @throws IllegalArgumentException if the key for the series is null or\\\\n * not unique within the dataset.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testRenameSeries() { XYSeries s1 = new XYSeries(""S1""); XYSeries s2 = new XYSeries(""S2""); XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(s1); dataset.addSeries(s2); try { s2.setKey(""S1""); fail(""Should have thrown IndexOutOfBoundsException on negative key""); } catch (IllegalArgumentException e) { assertEquals(""java.beans.PropertyVetoException: Duplicate key"", e.getMessage()); } }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thiss two new of the list. returns the messagelink
asetEventEvent}nnn * to all listen listeners.\\\\n * \\\n * @param series the the series tonotcode>null</code> not allowed).\\\\n * @\\\n * @throws IllegalArgumentException if the given is the series is already. if\\n * if a. the collection.\\\\n *\ ']
### Inst:Unit:::
sierpTest public public void addAddebSeries() throws RYDat series = = new XYSeries(""S1""); XYSeries s2 = new XYSeries(""S2""); XYSeries s series = new XYSeriesCollection(); dataset.addSeries(s1); dataset.addSeries(s2); dataset { dataset1.setName(S2""); s(""Ex throw thrown IlOutOfBoundsException""); rename index.""); } catch catch (IndexlegalArgumentException e) { assertEquals(""S.lang.PropertyVetoException: Propertylicate key S e.getMessage()); } }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(\'/**\\\\n * @throws IllegalArgumentException\\\\n * @throws FileSystemAlreadyExistsException\\\\n * @throws ProviderNotFoundException\\\\n * @throws IOException\\\\n * @throws SecurityException\\\\n * @see <a href=""http://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystems.html#newFileSystem(java.net.URI, java.util.Map)"">Original JavaDoc</a>\\\\n */\', \'\')']
### Test JUnit in Java:
","@Test public void newFileSystemNull5() { assertThatThrownBy(() -> FileSystems.newFileSystem(URI.create(""jgit:///test""), null, null)) .isInstanceOf(IllegalArgumentException.class) .hasMessage(""Parameter named 'env' should be not null!""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp ru of Theow. a in in is the lot of a, a.
a second.....
TheThe# \: The
A'J
''']
Authorrows
legalArgumentType {thn
* @throws Il..arm
nn
* @throws Ilxy
Exception
nn * @throws Il
nn * @throws IlException
nn * @th \@ href="""">://th.xyz.com/"">/th.1.1/1/1/th/niSystemAl.class/\thSystems1.lang,th)java.lang.n, *
Title</</a>
nn\\ *@n *\\n
\\#\
UnitTest Java
\## sierpth
@ static
Test
In
public false;rows;( ->)Systems.javaFileSystemInFile,java(java..jj. ""); null,
{
TestOf(FilelegalArgument).class)
.getTh()j name 'a' is not a null"")
}
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// Contains header some params?\\n')""]
### Test JUnit in Java:
","@Test(expected = RestException.class) public void media_type_wrong_three_parts() { MediaType.of(""application/json/xml""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow: a anor
:
of a that the,
a
to....
TheThe#
:
##\\ '
'inue
of.
\\\\
#####
the.
## sierpJ
J) Testrict,
,J Test. .test_test in_w_one_
Test in.
.J.of/j/
Media /"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * @param subClass Class\\\\n\\\\t * @return true if, given subClass is accessible from the parameterized class\\\\n\\\\t * @should return true if given subClass is accessible from given parameterized class\\\\n\\\\t * @should return false if given subClass is not accessible from given parameterized class\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test @Verifies(value = ""should return true if given object is accessible from given parameterized class"", method = ""isSuperClass(Object)"") public void isSuperClass_shouldReturnTrueIfGivenObjectIsAccessibleFromGivenParameterizedClass() throws Exception { Reflect reflect = new Reflect(OpenmrsObject.class); Assert.assertTrue(reflect.isSuperClass(new OpenmrsObjectImp())); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thisparam anet * to\\n\\\\t * @param String if the and aClass, a, the currentized class\\\\n\\\\t */ @th return true if, subClass is accessible from the parameterized class\\\\n\\\\t * @param return false if given subClass is not accessible from given parameterized class\\\\n\\\\t *"" ']
### InstsUnit: the:
sierpTest publicpublicSuppify(value = ""should return true if given sub is accessible from given parameterized class"", method = ""isAccessClassAccessClass)"") publicpublic void isSuperClass_shouldReturnTrueIfGivenObjectIsAccessibleFromGivenParameterizedClass() { Exception { Classlectionive = new Reflect();TestCrsPat.class); assert .assertTrue(reflect.isSuperClass(new OpenmrsObject()));orter "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '//$NON-NLS-1$\\n')""]
### Test JUnit in Java:
","@Test public void getId() throws Exception { try (SessionMirror session = provider.create(""testing"")) { assertThat(session.getId(), is(""testing"")); } }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\ '
'''S'YWN.N'\\
#####
the
## sierpJ
@
@ as
public{I,,,., .
()J. public
public(.null,testTest,
aJ"")
public public Test"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Add model elements from the specified map. When <tt>resolveExpressions</tt> is <tt>true</tt> the map may contain\\\\n\\\\t * String EL expressions that will be resolved as the model is built.\\\\n\\\\t * @param map a map of items to add to the model or <tt>null</tt>\\\\n\\\\t * @param resolveExpressions if the EL expression from <tt>String<tt> values in the map should be resolved.\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test public void shouldNotAttemptResolveOfMalformedExpressions() throws Exception { Map<String, Object> map = new HashMap<String, Object>(); map.put(""m1"", ""#{expression""); map.put(""m2"", ""#expression}""); map.put(""m3"", ""#}expression{""); map.put(""m4"", new StringBuffer(""#{expression}"")); this.modelBuilder.add(map, true); verifyZeroInteractions(this.application); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thiss to to a given model to\\ thecode>add</ions</tt> is <tt>true</tt>, the expressions is contain expressionsnn\\\\t * expressions expressions expressions that will be resolved to model corresponding elements built. When\\n\\\\t * <param model The map of model to add to the model\\ <tt>null</tt> if\\n\\\\t * @param resolveExpressions if < map expressions should thett>map</tt> map in the map should be resolved\\\\\\n\\\\t *\\ '""]
### Solution:Unit: the:
sierpTest publicpublic void testAddAddemptToutionExpressExpressformedExpressionions() throws Exception {
Map<String, Object> model = new HashMap<String, Object>(); map.put(""foo"","", ""{m} map.put(""m2"", ""#{"");""); model.put(""m3"", ""#{"");"");""); map.put(""m4"", ""# Object[](""#{expression""));"")); map.model..addExpressmap); true); thisNoInteractions(this.modelContext }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Throws {@link MenohException} if the <code>errorCode</code> of a native Menoh function is\\\\n * non-zero. This method must be called right after the invocation because it uses <code>\\\\n * menoh_get_last_error_message</code>.\\\\n *\\\\n * @param errorCode an error code returned from the Menoh function\\\\n */', '')"", ""('', '// ErrorCode.valueOf() throws MenohException if the error code is undefined\\n')""]
### Test JUnit in Java:
",@Test public void checkErrorSuccess() { checkError(ErrorCode.SUCCESS.getId()); },"OOOOOOOOOOOOOOOOOOOOOOO sierp$ru: Aow, the acceptable ( tells the process of a. a.
a paper codeAVA...
The
# \:
\_*n""""] */u:link thisges}
( correspondingT>
:</code>
the method methodohException. annn\\ * Th-native-
is was be called from after the <ocation of of is thecode>errorun * nonoh.th_0</1Codecode_code>
nn * nonnn non * nonth \Code
errorCode. by a invoh function is\\\\ *
""\\/** ""\\',Code.
("", javaohException. the <Code of\\.n\\
# sUnit test Java.
sierpTest
public void test()()() {
}ErrorSuccessintCode.classCCESS);class());());
}
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * {@inheritDoc}\\\\n * <p>\\\\n * Overridden to parse a string to a {@link Durability}.\\\\n * </p>\\\\n *\\\\n * @throws IllegalArgumentException\\\\n * If the string cannot be parsed into a {@link Durability}.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testSetMajority() { final DurabilityEditor editor = new DurabilityEditor(); editor.setAsText(""MAJORITy""); assertThat(editor.getValue(), is((Object) Durability.replicaDurable(Durability.MAJORITY_MODE, DurabilityEditor.DEFAULT_WAIT_TIME_MS))); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public ThislinkheritDoc}nnn */ \p>\This\\n * <ridden to return the string that a doublelink javaations}\\\n * <p>\\\\\n * @\\n * @paramrows ParselegalArgumentException if\\n * if the string is be parsed to a {@link Durability}.\\\\n *\ ']
### Ex:Unit:::
sierpTest public public void testParseDeterorVersion() throws Dur Stringability dur editor = new DurabilityEditor(); editor.setMText(""'JORITYIES""); assertEquals(editor.get(), is is(D) Durability.MAair));ur()));trueurability.MAJORITY)));V))); newability..DEFAULT_REIT_TIME)));IN))); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/** Return desired Open GL Capabilities */', '')""]
### Test JUnit in Java:
","@Test public void hasGoodSettingsToMakeOnscreenRenderingWithColor() { NativePainterFactory f = newAbstractNativePainterFactory(); GLCapabilities caps = f.getCapabilities(); Assert.assertTrue(caps.getHardwareAccelerated()); Assert.assertTrue(caps.isOnscreen()); Assert.assertEquals(8, caps.getAlphaBits()); Assert.assertEquals(8, caps.getRedBits()); Assert.assertEquals(8, caps.getBlueBits()); Assert.assertEquals(8, caps.getGreenBits()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\' to:...,
'
#####
the
## sierpJ
1
as
the sureur,,ing,out,
@,remtsest,g FPPaintst
@tMl;. newg
Fabilities;
Gion
s.f),f))))ording,,
G.
s.f),f.ur,)
G.fs,c,1)fF)eta) G.fs(c,1)fFs)) G.fs(c,1)getF))) G.gets(c,c.getF))) 1
."
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Updates to set the reply for the callback, if any.\\\\n *\\\\n * @param receiver\\\\n * The socket receiving the message.\\\\n * @param reply\\\\n * The reply.\\\\n * @param replyCallback\\\\n * The callback for the reply to the message.\\\\n * @param executor\\\\n * The executor to use for the back-grounding the reply handling.\\\\n */', '')"", ""('', '// We know the FutureCallback will not block or take long to process\\n')"", ""('', '// so just use this thread in that case.\\n')"", ""('', '// Run on this thread.\\n')""]
### Test JUnit in Java:
","@Test public void testReplyWithNonLightWeightCallbackNoExecutor() throws InterruptedException, ExecutionException { final List<Document> docs = Collections.emptyList(); final Reply reply = new Reply(0, 0, 0, docs, false, false, false, false); final Message mockMessage = createMock(Message.class); final ReplyCallback callback = createMock(ReplyCallback.class); expect(callback.isLightWeight()).andReturn(false); callback.callback(reply); expectLastCall(); replay(mockMessage, callback); ReplyHandler.reply(null, reply, callback, null); verify(mockMessage, callback); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisdates the the the value to the given. if the.\\\\n * @\\n * @param reply The\\n * The receiver to the callback.\\\\n * @param reply\\\\n * The reply to\\\\n * @th callbackType\\\\n * The callback to the reply. the message.\\\\n * @th callbackutor\\\\n * The executor to run for the callback-off task of callback..\\\\n *""] '""] ""public/** 'public', need that message is is be be. throw long. complete.\\//"", ""('', '// We we return the to to the case.\\n')"", ""('', '// We the the thread.\\n')"",
### Ex:Unit: the:
sierpTest public public void test_ly()CallbackBlockweightFuture()Executor() throws throws ExceptionruptedException, ExecutionException { final Socket<Future> docs = newlections.singList(); final DocumentlyFuture = new Reply(docs, docs0, docs0, ); null); null); false, false, final Future messageMessage = mockMockMessageMessage.class); final SocketlyCallback mock = newMock(ReplyCallback.class); final(mock.getLightWeight()).andReturn(false); expect.rep(mockly); reLastCall(). expectplay(callbackMessage, callback); finallyFuture handlerhandlely(mock, mock, null, null); verify(mockMessage, callback); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// Get the filter values\\n')"", '(\'\', ""// Min can\'t be greater than max.\\n"")']
### Test JUnit in Java:
","@Test public void appendBetweenIntervalSelectionTest() { String filterValue = ""testValue""; Long minValue = Long.valueOf(0); Long maxValue = Long.valueOf(2); DataSetGroup dataSetGroup = new DataSetGroup(); dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST, COLUMN_TEST, GroupStrategy.DYNAMIC)); List<Interval> intervalList = new ArrayList<Interval>(); Interval interval = new Interval(filterValue); interval.setMinValue(minValue); interval.setMaxValue(maxValue); intervalList.add(interval); dataSetGroup.setSelectedIntervalList(intervalList); List<QueryParam> filterParams = new ArrayList<>(); kieServerDataSetProvider.appendIntervalSelection(dataSetGroup, filterParams); assertEquals(1, filterParams.size()); assertEquals(COLUMN_TEST, filterParams.get(0).getColumn()); assertEquals(""BETWEEN"", filterParams.get(0).getOperator()); assert","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test] ')'', the value' fromn',""] ""//'', '// Getimum bet be null than max\\\\n"")',
### Inst:Unit: the:
sierpTest public public void testFilteretween()s()() { Filter[] = = ""1"";""; String min = = .valueOf(1); Long maxValue = Long.valueOf(1); FilterTableFilteringSetGroup = new DataSetGroup(); dataSetGroup.setFilter((0 ColumnGroup());0UMN_GROUP_ COL newUMN_TEST_ COLType.INTERENNAMIC, data<DataSet> intervalsList = new ArrayList<Interval>(); intervalval interval = new Interval(minValue, intervalListsetMinValue(minValue); interval.setMaxValue(maxValue); dataList.add(interval); dataSetGroup.setIntervalIntervals(intervalList); Data<DataSetResult> queryList = new ArrayList< filtersqlker...setBSelection(dataSetGroup, filter filterParams); assertEquals(filter, filter filterParams.size()); assertEquals(filterUMN_TEST, filterParams.get(0).getColumn()); assertEquals(testetWEEN"", filterParams.get(0).getOperator()); assertEquals"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Get field with the specified name.\\\\n\\\\t * @param targetClass class for which a field will be returned\\\\n\\\\t * @param fieldName name of the field that should be returned\\\\n\\\\t * @return field with the specified name if one exists, null otherwise\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test public void testGetNonExistingField() { Field field = ClassUtils.getField(TestBean.class, ""nonExistingField""); Assert.assertEquals(field, null); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\
\\\\\\\n\\\\ the. the
..
nn\\tn\\\\\\et... the... be a.nn\\tn\\\\\\\\\\\\\\ the field.\\ be a\\nn\\tt\\\\param\\\\ the field name\\ the of a two,,nn\\tt\\@@\\
#####@.
the\\
## sierpparamJ@\\\\
ting-am the,
\\@@ , ..
.field),get)TestTest""""Field"" @@Jjava .Test, ) @ "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Invoke a private or inner class method without the need to specify the\\\\n\\\\t * method name. This is thus a more refactor friendly version of the\\\\n\\\\t * {@link #invokeMethod(Object, String, Object...)} method and is recommend\\\\n\\\\t * over this method for that reason. This method might be useful to test\\\\n\\\\t * private methods.\\\\n\\\\t * \\\\n\\\\t * @throws Exception if something wrong.\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test public void testInvokePrivateMethod_primtiveType_withoutSpecifyingMethodName() throws Exception { assertTrue((Boolean) Whitebox.invokeMethod(new ClassWithUniquePrivateMethods(), 8.2d, 8.4d)); }","OOOOOOOOOOOOOO sierp##rus
ow, the acceptable ( is the process of a. a.
a method codeSPTest..
Write
# :
\a/n\\\\\\n\\\\ the the method method protected class.. arguments class to create its receiving\\\\\\tt * parameter arguments.
is a a method generaling language of the\\\\\\\\\\t * methodliter #1}}Object, int, Object...)}
. will thusable\\\\\\\\t * to the.. the..
is is be called for the.\\\\\\\\t * the void.
\\n\\\\t * This\\\\n\\\\t * privateOverriderows java
the goes.
\\n\\\\t *
# :Unit Test Java
public sierpOverride public public void testGetMethodMethod()withitiveive()()no_ifyingMethodName() throws Exception {
ObjectEquals(()((box.invokePrivate(this Object<?outqueMethodMethod(), ""1,0f, 1.2d)); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Generate the packing instruction suitable for modifying the comment\\\\n\\\\t * associated with the given user.\\\\n\\\\t *\\\\n\\\\t * @param userName\\\\n\\\\t * {@code String} with the iRODS user name.\\\\n\\\\t * @param comment\\\\n\\\\t * {@code String} with the data to be stored in the user comment.\\\\n\\\\t * @return {@link GeneralAdminInp}\\\\n\\\\t * @throws JargonException\\\\n\\\\t * for iRODS error\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test(expected = JargonException.class) public void testModifyUserCommentNullComment() throws Exception { GeneralAdminInp.instanceForModifyUserComment(""user"", null); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thisate a randomed list for for the the contents.\\n\\\\t * @ with the given element.\\\\n\\\\t * @\\n\\\\t * @param user\\\\\\t\\\\t * The Thelink User} the the nameDDS user name\\\\\\n\\\\t * @param comment\\\\n\\\\t * {@code String} with the comment comment be pack in the comment\\.\\\\n\\\\t * @return\\code StringInstistrationstr}\\\n\\\\t * throws GeneralRonException\\\\n\\\\t * if anyRODS errors.\\n\\\\t *\\ '""]
### Inst:Unit: the:
sierpTest publicexpected = JargonException.class) public void testGenerifyUserComment()()() throws J { GeneralAdminInp inmod().ModifyUserComment("","", null); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Introspects the given entity and returns the metadata associated with the entity.\\\\n *\\\\n * @param entity\\\\n * the entity object to introspect.\\\\n * @return the metadata of the entity\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testIntrospect_MultiThreaded() { class MyRunnable implements Runnable { private Class<?> clazz; public MyRunnable(Class<?> clazz) { this.clazz = clazz; } @Override public void run() { EntityMetadata metadata = EntityIntrospector.introspect(clazz); System.out.println(metadata); } } ; Thread[] threads = new Thread[4]; Class<?>[] entityClasses = { StringId.class, StringField.class, StringId.class, StringField.class }; for (int i = 0; i < threads.length; i++) { threads[i] = new Thread(new MyRunnable(entityClasses[i])); threads[i].start(); } for (int i = 0; i < threads.length; i++) { try { threads[i].join(); } catch (InterruptedException e) { e.printStackTrace(); } } }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisrodupectionor a given object and returns the list of with it given.\\\\n * @\\n * @param entity The\\n * The The entity to to introspect\\\\\\n * @return the metadata associated the entity.\\n *"" ']
### Inst:Unit: the:
sierpTest public public void testGetrospect()Returnpleed() throws try TestEntityunnable implements Runnable { public final<?> clazz; private MyRunnable(Class<?> clazz) { this.clazz = clazz; } @Override public void run() { tryMetadata metadata = EntityMetadatarospector.getrospect(clazz); assert.out.println(metadata); } } List Exec[] threads = new Thread[1]; for<?>[] classesClasses = new ..class, StringId.class, StringField.class, String StringField.class, for (int i = 0; i < entity.length; i++) { threads[i] = new Thread(new MyRunnable(entityClasses[i])); threads[i].start(); } for (int i = 0; i < threads.length; i++) { try { threads[i].join(); } catch (InterruptedException e) { e.printStackTrace(); } } }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Allocates new instance using {@link sun.misc.Unsafe} so that its constructor is not invoked.\\\\n *\\\\n * @param clazz class instance of which to create\\\\n * @param <T> type of object\\\\n * @return newly allocated instance of class\\\\n */', '')""]
### Test JUnit in Java:
","@Test void testUnsafeInstance() { assertNotEquals(new Object99(), newUnsafeInstance(Object99.class)); assertEquals(0, newUnsafeInstance(Object99.class).value); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\
\\\\\ \\
phaate.
theted}
..
un.at
.
a. a a.
nn\\ *
nn\\ *\\\\.uses... the\\ the newnn\\ *\\\\\\\\>\\. the.nn\\ *\\param\\.\\ of the.nn\\ *@@\\
#####@.
the
## sierp@J *
uper
at
* thatNull}J,),, ObjectObjectuper)))new1,)new)
*Not(new,0Objecta)))new1,)new)
)
*@@"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Creates a matcher that matches when the examined XML input has a value at the\\\\n * specified <code>xPath</code> that satisfies the specified <code>valueMatcher</code>.\\\\n *\\\\n * <p>For example:</p>\\\\n * <pre>assertThat(xml, hasXPath("//fruits/fruit/@name", equalTo("apple"))</pre>\\\\n *\\\\n * @param xPath the target xpath\\\\n * @param valueMatcher matcher for the value at the specified xpath\\\\n * @return the xpath matcher\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void createsAUsefulMessageWhenFailingCombinedWithNotOnTheOutside() throws Exception { thrown.expect(AssertionError.class); thrown.expectMessage(""not XML with XPath count(//fruits/fruit) evaluated to \""3\""""); String xml = ""<?xml version=\""1.0\"" encoding=\""UTF-8\""?>"" + ""<fruits>"" + ""<fruit name=\""apple\""/>"" + ""<fruit name=\""orange\""/>"" + ""<fruit name=\""banana\""/>"" + ""</fruits>""; assertThat(xml, not(hasXPath(""count(//fruits/fruit)"", equalTo(""3"")))); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\\
\\\\\ =
ator a method... a the
ination a.. a method. the endnn\\ * Cre\\\\>
\\scode>
\\ the\\ <\\>
</es</code>
nn\\ *\\nn\\ *\\code>\\um.
p>\\nn\\ *\\p>\\ed thex\\x a\\\\\\;\\\\\\)f//f/f;\\\\,,\\;\\&\\;\\/p>\\nn\\ *\\nn\\ *\\\\\\\\\\\\ of\\,nn\\ *\\\\\\\\es\\er\\ the exam of the end xpath\\nn\\ *\\param\\ valuepath\\er\\nn\\ *@ *@
\\#'.UnitTest the.
## sierp@J *
a
the.. theures
es
Messageouteslineirer
s2 *,
}1ion))java)
*.
(."","","")X""). X))/f// /(/\}
\[]; ""3>>>3\""1."";1\1\""\"" "" +"">> + "" ""fruits>=""f\"">
+ "" ""fruits>=""f\\"">"" + "" ""fruits name=""orana\"">"" + "" ""fruit>
< false thef)f,x)))X"")X))/fruits/"",)f"") +
*
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Retrieves the template of an existing template name and language under the first waba connected to the requesting user.\\\\n *\\\\n * @param templateName A name as returned by getWhatsAppTemplateBy in the name variable\\\\n * @param language A language code as returned by getWhatsAppTemplateBy in the language variable\\\\n *\\\\n * @return {@code TemplateResponse} template\\\\n * @throws UnauthorizedException if client is unauthorized\\\\n * @throws GeneralException general exception\\\\n * @throws NotFoundException if template name and language are not found under the first waba connected to the requesting user.\\\\n * @throws IllegalArgumentException if the provided arguments are not valid\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testFetchWhatsAppTemplateByNameAndLanguageForChannelID() throws UnauthorizedException, GeneralException, NotFoundException { final String templateName = ""sample_template_name""; final String language = ""ko""; final String channelID = ""channel-id""; final TemplateResponse template = TestUtil.createWhatsAppTemplateResponse(templateName, language); MessageBirdService messageBirdServiceMock = mock(MessageBirdService.class); MessageBirdClient messageBirdClientInjectMock = new MessageBirdClient(messageBirdServiceMock); String url = String.format( ""%s%s%s/%s/%s?channelId=%s"", INTEGRATIONS_BASE_URL_V2, INTEGRATIONS_WHATSAPP_PATH, TEMPLATES_PATH, templateName, language, channelID ); when(messageBirdServiceMock.request(url, TemplateResponse.class)) .thenReturn(template); final TemplateResponse response = messageBirdClientInjectMock.fetchWhatsAppTemplateBy(templateName, language, null,","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisves the value name the element template.. returns. the given leveliki\\ to the current. client.
\\n * @\\n * @param templateName The template of defined by theTemplateitelNewTemplateNameName the Wh field.\\n * @param language The language as as returned by getWhatsAppTemplateBy in the language variable\\\\n * @\\n * @return Thelink null}} containing response\\n * @throws WauthorizedException if the is notuthorized to\\n * @throws NotException if if exception\\\\n * @throws InvalidFoundException not the does is language do not found\\ the first waba connected to the requesting user.\\\\n * @throws InvalidlegalArgumentException if template template template are invalid valid.\\n *\ ']
### Inst:Unit: Java:
sierpTest public public void getGetTemplateatsAppTemplateBy()AndLanguage()First()() throws GeneralauthorizedException, GeneralException, NotFoundException, Template String channelName = ""templateTemplatetemplate"";name""; final String language = ""sample""; final String channelID = ""1_id""; final StringResponse templateResponse templateUtil.getTemplateatsAppTemplateResponse(templateName, language); finalTemplateasedClient messageBirdService = = mock(MessageBirdService.class); whenBirdClient messageBirdClientMocked = mock MessageBirdClient(messageBirdServiceMock); Wh expected = "".format(""URL ""/s/s%s"",s/%s"",channel_=%s"", ""/STGRATION__BASE_URL,W1, ""/TEGRATIONS_APIATSAPP_BASE, INSTLATEES_PATH, TEName, language, channelID); ); when(messageBirdServiceMock.get(url, HttpRequest.class)). .thenReturn(template); Wh WhResponse actual = clientBirdClientInjectMock.fetchWhatsAppTemplateByNametemplateName, language, channel, channel"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// First cache is key to resource.\\n')"", '(\'\', ""// If we haven\'t yet parsed the template into the cache, do so now.\\n"")']
### Test JUnit in Java:
","@Test public void child_component_inherits_parent_template() { TemplateParser parser = mockTemplateParser(); ComponentTemplate template = mockComponentTemplate(); ComponentModel model = mockComponentModel(); ComponentModel parentModel = mockComponentModel(); Resource resource = mockResource(); ComponentResourceLocator locator = mockLocator(model, english, null); final String className = ""foo.Bar""; train_getComponentClassName(model, className); train_getParentModel(model, parentModel); expect(locator.locateTemplate(parentModel, english)).andReturn(resource).once(); expect(resource.exists()).andReturn(true); expect(resource.getPath()).andReturn(className.replace(""."", ""/"") + "".tml""); expect(resource.toURL()).andReturn(null); train_parseTemplate(parser, resource, template); replay(); ComponentTemplateSource source = new ComponentTemplateSourceImpl(true, false, parser, locator, converter, componentRequestSelectorAnalyzer, threadLocale, logger); assertSame(source.getTemplate(model, english), template); ","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test] ')'', line miss emptyed success sharing',n',""] ""//""', '// Second the have't cached cached the resource, a model, we it..\\n"")',
### Inst:Unit: the:
sierpTest public public void testOfof_template_its_parent_cache_ { { Template template parser = new(Parser(); when component template = mockTemplateTemplate(); whenTemplate model = mockComponentModel(); whenModel childModel = mockComponentModel(); when resource = mockResource(); whenModel resourceator locator = mockComponentator();resource, resourcelish); resource, when String expected = ""com.bar""; when(template_Model(parser, className); when_getComponentTemplate(model, parentModel); train(parserator.getate((parentModel, classNamelish)).andReturn(template);any(); expect(resource.get()).andReturn(true). expect(resource.getTemplate()).andReturn(""new);replace('."", ""/""));). "".html""); expect(resource.getInputStream()).andReturn(new); expect_getTemplate(parser, template, eng); expectplay( assertResource child source = new ComponentTemplateSource((parser, parser, false, templateator); template); engModel,,alyzer, nullContextale, eng); sourceEqualsame(template,getTemplate(),model), english), template); assert"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * @return Returns the encounterTypeId.\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test @Verifies(value = ""should set encounter type id with given parameter"", method = ""EncounterType(Integer)"") public void EncounterType_shouldSetEncounterTypeIdWithGivenParameter() throws Exception { EncounterType encounterType = new EncounterType(123); Assert.assertEquals(123, encounterType.getEncounterTypeId().intValue()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\'/\\\\\\n\\\\\\. the
. ofi
tt\\tn\\
#####
.
the.
## sierp@
@Jify
J) @J"""""","" the,, "", ""shouldounter""""should,J@;,ounterType,Jer@ounterType,,iniven,,@ asshouldshouldshouldounterType}}} EncJounterType{should),, EncEncion
s( ,,)1,)Enc)ounterType))
.) Enc "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Returns null-safe collection proxy for thrift generated class.\\\\n\\\\t *\\\\n\\\\t * @param source thrift generated instance\\\\n\\\\t * @param <T>\\\\n\\\\t * @return a wrapped proxy\\\\n\\\\t */', '')"", ""('', '// null is null...\\n')"", ""('', '// should it look for parents classes??\\n')"", ""('', '// TODO: these can be cached\\n')"", ""('', '// traverse all non-null thrift class attributes\\n')"", ""('', '// recursively call wrap method.\\n')"", ""('', '// check values in collection\\n')"", ""('', '// check map values??\\n')"", '(\'\', ""// doesn\'t make proxy\\n"")', ""('', '// interceptor that handles thrift write method\\n')"", ""('', '// make proxy\\n","@Test public void testWrap() throws Exception { Foo foo = new Foo(""foo"", new ArrayList<String>(), new HashSet<String>(), new HashMap<String, String>()); Bar bar = new Bar(); Baz baz = new Baz(); bar.setName(""bar""); baz.setName(""baz""); bar.setBaz(baz); foo.setBar(bar); // initially all options are null assertThat(foo.getName(), is(""foo"")); assertThat(foo.getRequiredList(), is(emptyCollectionOf(String.class))); assertThat(foo.getRequiredSet(), is(emptyCollectionOf(String.class))); assertThat(foo.getRequiredMap(), is(notNullValue())); assertThat(foo.getRequiredMap().size(), is(0)); assertThat(foo.getOptionalList(), is(nullValue())); assertThat(foo.getOptionalSet(), is(nullValue())); assertThat(foo.getOptionalMap(), is(nullValue())); assertThat(bar.getName(), is(""bar","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ This the ifsafe version of for theift collection collection.\\\\n\\\\t * @\\n\\\\t * @param thr\\ift generated class.\\n\\\\t * @return <T> type\\n\\\\t * @return\\ proxy collection collection\\n\\\\t */"" '] ""public/** 'public Returns- returned\\',\\\\"", ""('', '// ... be be like a??\\n')"", ""('', '// should: should are be removed\\n')"", ""('', '// TODO the the-null parentsift generated\\\\n')"", ""('', '// TODOively traverse this\\ for\\n')"", ""('', '// TODO if are the\\n')"", ""('', '// check values values in\\n')"", ""publicn', '// check't matter sense\\n"")', '('', '// checkceptor is will nullift generated\\\\n')"", ""('', '// inter sure\\n') sierpOverride publicpublic void testWrap() throws Exception {', T foo = new Foo();foo""); Foo<String>()); new HashMapSet<String>()); new HashMap<String, String>()); Foo bar = new Bar("" baraz baz = new Baz(); foo.fooFoo(""bar""); baz.setName(""baz""); foo.setBaz(baz); foo.setBar(bar); foo should, null are false fooNull(foo.get()). is(foo"")); assertThat(foo.getB(),(), is(null()));()));(String.class))); assertThat(foo.getRequiredSet(), is(emptyCollectionOf(String.class))); assertThat(foo.getRequiredMap(), is(emptyNullValue())); assertThat(foo.getRequiredMap().get(), is(0)); assertThat(foo.getRequiredList(), is(emptyValue())); assertThat(foo.getOptionalSet(), is(nullValue())); assertThat(foo.getOptionalMap(), is(nullValue())); assertThat(foo.getName(), is(""bar""));"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Function for voice call to a number\\\\n *\\\\n * @param voiceCall Voice call object\\\\n * @return VoiceCallResponse\\\\n * @throws UnauthorizedException if client is unauthorized\\\\n * @throws GeneralException general exception\\\\n */', '')""]
### Test JUnit in Java:
","@Test(expected = IllegalArgumentException.class) public void shouldThrowIllegalArgumentExceptionWhenDestinationOfVoiceCallIsMissing() throws UnauthorizedException, GeneralException { final VoiceCall voiceCall = new VoiceCall(); voiceCall.setSource(""ANY_SOURCE""); final VoiceCallFlow voiceCallFlow = new VoiceCallFlow(); VoiceStep voiceStep = new VoiceStep(); voiceStep.setAction(""say""); final VoiceStepOption voiceStepOption = new VoiceStepOption(); voiceStepOption.setPayload(""This is a journey into sound. Good bye!""); voiceStepOption.setVoice(VoiceType.male.getValue()); voiceStepOption.setLanguage(""en-US""); voiceStep.setOptions(voiceStepOption); voiceCallFlow.setSteps(Collections.singletonList(voiceStep)); voiceCall.setCallFlow(voiceCallFlow); messageBirdClient.sendVoiceCall(voiceCall); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: anor
:
of a that the,
a
to....
TheThe#
:
##\\
\\\\\ =
( the.. the method ofnn\\ *
nn\\ *\\\\\\\\erice\\..nn\\ *\\\\\\ice\\ the\\nn\\ *\\\\ese\\ite\\\\s\\. authorse\\nn\\ *\\returnrows\\\\\\ *\\\\nn\\ *@@
#####@ing
, the\\
## sierpthJJ) truelegal)))
)J *\\ in beablelegalArgument,,everroy,fero,,,aing, @IlcaughtizedV, UnException,@ *}ice},,, VoJiceCall,
*Call,
..Vew"",ZCE"",
* VoiceCall,ersCall,ers \JiceCall;ers finaliceCallVCallV newViceCall; VoCallV
.;A"",
Vo VoiceCall;;Step;; ViceStep;; finalStep;;
;roll;C"", a method. theness
se.
VoStep;;
;o;;ao)))V.V.
VoStep..
V.This"");"""",
VoStep;
V.1,,.
VoStep;ers
;ve;V)
ular))s))
voiceStep;
;;.VStep);); voice....
;o;;;V)); voice
ve"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Validate.\\\\n *\\\\n * @param msg the Round Change msg\\\\n * @return the boolean\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void insufficientPiggyBackedPrepareMessagesIsInvalid() { when(payloadValidator.validate(any())).thenReturn(true); when(blockValidator.validateAndProcessBlock(any(), any(), any(), any())) .thenReturn(new BlockProcessingResult(Optional.empty())); messageValidator = new RoundChangeMessageValidator( payloadValidator, BftHelpers.calculateRequiredValidatorQuorum(VALIDATOR_COUNT), CHAIN_HEIGHT, validators.getNodeAddresses(), protocolContext, protocolSchedule); final Block block = ProposedBlockHelpers.createProposalBlock( Collections.emptyList(), roundIdentifier, bftExtraDataEncoder); final PreparedCertificate prepCert = createPreparedCertificate( block, roundIdentifier, validators.getNode(0), validators.getNode(1)); final RoundChange message = validators.getMessageFactory(0).createRoundChange(targetRound, Optional.of(prepCert)); assertThat(messageValidator.validate(message)).isFalse(); }","OOOOO everybody################rus kwietow the the example of is how step in property. the.
a method instructionav test case.
publicpublic# Example
Thea/\\\\\\ * ates thejava\\n *\\\\n * @param value The messageMessage Message\\\\n * @return true result result\\n *\\ '""]
### SolutionsUnit: Action:
sierpTest public public void testufficientFrivgyBsRigare()()Invalid() {
P(mock..validate(any(),).thenReturn(false); when(payloadchain.validate(Get((any()) any()) any(), any(),
.thenReturn(true BlockValidationingResult(true.of(), whenValidator. mock new MessageChangeMessageValidator(new newValidator, block blockLOCKEnginepers.createatePPCountorum(1ATOR_COUNT, BANGEIN_IDIGHT, Bator,stream(Ides(), BVersion); BContextedule, when Round block = new newtocolBlock.pers.createProposedalBlock(VALID Blections.singList(), Change, ftRData,oder. final BlockrepareBlockified preparedCert = newPreparedCertificate(block block, Identifier, bators);getNodeAddress0). ators.getNode(1), final PChangeMessage = createator.get(().protocol).createRoundChangeMessage ,ound, .of(prepCert), finalThat(messageValidator.validate(message)).isFalse(); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Deletes all second stage authorities assignments of the given person.\\\\n *\\\\n * @param event the person who is deleted\\\\n */', '')""]
### Test JUnit in Java:
","@Test void ensureDeletionOfSecondStageAuthorityAssignmentOnPersonDeletionEvent() { final Person secondStageAuthority = new Person(); secondStageAuthority.setId(42L); final Person other = new Person(); other.setId(21L); final DepartmentEntity department = new DepartmentEntity(); department.setId(1L); department.setSecondStageAuthorities(List.of(secondStageAuthority, other)); when(departmentRepository.findBySecondStageAuthorities(secondStageAuthority)).thenReturn(List.of(department)); when(departmentRepository.findById(1L)).thenReturn(Optional.of(department)); when(departmentRepository.save(department)).thenReturn(department); sut.deleteSecondStageAuthority(new PersonDeletedEvent(secondStageAuthority)); verify(departmentRepository).findBySecondStageAuthorities(secondStageAuthority); ArgumentCaptor<DepartmentEntity> argument = ArgumentCaptor.forClass(DepartmentEntity.class); verify(departmentRepository).save(argument.capture()); ","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisletes a the level files fromments for the given user.\\\\n * @\\n * @param person the event to is to\\\\n *""] '""]
### Inst:Unit: the:
sierpTest public public testDeleteletesOfSecondStageAuthoritiesAssign()PersonDeletion()() { Person Person personStageAuthorityAss new Person("" secondStageAuthority.setId(1LL); final Person personPerson new Person(); other.setId(4LL); final Person department department = new DepartmentEntity(); department.setId(1L); final.setNameStageAuthority(newsof(secondStageAuthority)); other)); final(departmentRepository.findById(StageAuthorities(anyStageAuthority)).thenReturn(de.of(department)); when(departmentRepository.findBy(anyL)).thenReturn(Optional.of(department)); when(departmentRepository.delete(department)).thenReturn(department); whenut.deleteSecondStageAuthorityAssnew PersonDeletEvent(secondStageAuthority)); assert(departmentRepository,deleteBySecondStageAuthorities(secondStageAuthority); verifyCaptor<DepartmentEntity> departmentCapt ArgumentCaptor.forClass(DepartmentEntity.class); verify(departmentRepository,save(argument.capture()); assert"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Sets the given property by calling the \\\\n * {@code super.setProperty(name, value)} method. Additionally, the\\\\n * property is filtered and if it contains subtitutable variables\\\\n * (i.e. ${PROPNAME}), they are replaced and set with their interpolated\\\\n * value.\\\\n * \\\\n * @param name the name of the property\\\\n * @param value the value of the property\\\\n * @return the previous value of the property, or {@code null} if it was\\\\n * not set\\\\n * @see java.util.Properties#setProperty(java.lang.String, java.lang.String)\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testCreationWithFunnyButValidVariableFormat() { Properties testProps = new Properties(); testProps.setProperty(""name2"", ""value""); testProps.setProperty(""name1"", ""${name2}}""); SubstitutionProperties p = new SubstitutionProperties(testProps); Assert.assertEquals(p.getProperty(""name1""), ""value}""); }","OOOOOOOOOOOOOOO sierp##ru:
ow, the acceptable ( tells how process of a. a.
a method codeSPTest..
Write
# :
\a/n\\\\ * @. the value value to the the set\\nn * Slink
}set((String,value)}
.
, the methodnn * {@ is set by the the is aitles values,\\\\ * {@\\,e. set@PER_} then are set by the to the valuesated values\\n * values.
\n * @\\\n * \Override name the name of the property.\\n * @param value the value of the property\\\\n * @return the value value of the property\\ or nullcode super} if the is never\\\ * {@ not set,\\n * @th #.lang.Properties#getProperty(String.lang.String, java.lang.Object)\\n *
# Method:Unit Test Java
sierpTest public public void testSetation()out()NameNotNameNames() {
assert propsProperties = new Properties(); testProps.setProperty(""foo"","", ""value2 assertProps.setProperty(""name3"", ""name2}""); assertjectitutionTest test = new SubstitutionProperties(testProps); assert.assertEquals(""p.getProperty(""name1""), ""value"");""); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Return an immutable instance of an {@code IRODSRule}\\\\n\\\\t *\\\\n\\\\t * @param ruleAsOriginalText\\\\n\\\\t * {@code String} with the plain text version of the rule\\\\n\\\\t * @param irodsRuleInputParameters\\\\n\\\\t * {@code List<IRODSRuleParameter>} containing the translated rule\\\\n\\\\t * input parameters\\\\n\\\\t * @param irodsRuleOutputParameters\\\\n\\\\t * {@code List<IRODSRuleParameter>} containing the translated rule\\\\n\\\\t * output parameters\\\\n\\\\t * @param ruleBody\\\\n\\\\t * {@code String} containing the body of the rule\\\\n\\\\t * @param ruleInvocationConfiguration\\\\n\\\\t * {@link RuleInvocationConfiguration} with information about the\\\\","@Test(expected = IllegalArgumentException.class) public void testInstanceNullOutputParams() throws Exception { RuleInvocationConfiguration irodsRuleInvocationConfiguration = new RuleInvocationConfiguration(); IRODSRule.instance(""xxxx"", new ArrayList<IRODSRuleParameter>(), null, ""yyy"", irodsRuleInvocationConfiguration); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ This the arrayutable list of this arraylink ArrayList}bject}}n\n\\\\t * @\\n\\\\t * @param rule theString The The\\n\\\\t * The Thecode I} containing the original text of of the rule\\\n\\\\t * @param rulerodsRuleFactory\\\\\\n\\\\t * {@code I<IRODSRuleInput>} with the parameters parameters parameters\\n\\\\t * @ parameters parameters\\\\n\\\\t * @return irodsRuleOutputParameters\\\\n\\\\t * {@code List<IRODSRuleParameter>} containing the translated rule\\\\n\\\\t * output parameters\\\\n\\\\t * @return iName\\\\n\\\\t * {@code String} with the rule of the rule\\\\n\\\\t * @return ruleNameParameters\\\\n\\\\t * {@code IInvocationConfiguration} containing the about the rule\\n sierpreturn\expected = IlegalArgumentException.class) publicpublic void testRuleCre()Parameters() throws Exception { IInvocationConfiguration rulerodsRuleInvocationConfiguration = new RuleInvocationConfiguration(); iroRODSRule igetInstance(rule"", i ArrayList<>IRODSRuleParameter>(), i, ""xxxxy"", ""rodsRuleInvocationConfiguration); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Sets the state of this task to {@code running}, returning {@code false}\\\\n * if the task has already been cancelled or has completed, or if the\\\\n * state is not being changed.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void setRunningTrueWhenInterrupted() throws Exception { setTaskState(""INTERRUPTED""); Assert.assertTrue(task.setRunning(true)); Assert.assertEquals(""RUNNING"", getTaskState()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\'/\\\\ \\
leep.
of the.. thet} the
thecode}}nnn{\ *
( state of been been aled the the been the has has, state\\n\\ *\\\\ a a a,
nn\\ *
\\
\###'ing
the
## sierpJJ *\\
ter the, theest,
as
*ter,,JN"",S"","",
*J
s.r,
,,2,
*.
True,F"","","","", ""Inter)) *
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * This function selects tasks following a strategy for submit in Arrebol.\\\\n *\\\\n * @return selected tasks list\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testSelectOneTaskWithFiveSubmissionCapacityWhenOneAvailableCreatedTasks() throws Exception, GetCountsSlotsException { Catalog imageStore = mock(Catalog.class); Arrebol arrebol = mock(Arrebol.class); Scheduler scheduler = createDefaultScheduler(new DefaultRoundRobin(), arrebol, imageStore); List<SapsImage> readyTasks = new LinkedList<SapsImage>(); List<SapsImage> downloadedTasks = new LinkedList<SapsImage>(); List<SapsImage> createdTasks = new LinkedList<SapsImage>(); SapsImage task01 = new SapsImage(""1"", ""landsat_8"", ""217066"", new Date(), ImageTaskState.CREATED, SapsImage.NONE_ARREBOL_JOB_ID, """", 5, ""user1"", ""nop"", """", ""nop"", """", ""aio"", """", new Timestamp(1), new Timestamp(1), """", """"); createdTasks.add(task01); when(imageStore.getTasksBy","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public This method takes the from the priority of selectinging aduinoars.\\\\n * @\\n * @param a tasks\\\\\\n *\\ ']
### Inst:Unit: Ar:
sierpTest public public void testSelectTasks()()StrategyiveTasksm()acity()AllTask()()() { throws Exception { InterExceptionExceptionExceptionotsException, final catalogC = new(Catalog.class); whenrebol arrebol = new(Arrebol.class); wheneduler scheduler = mockSchScheduler(image ArTaskunnableRobinStrategy imagerebol, imageStore); when<TasklotTask> imagesImages = new ArrayListList<>();SapsImage>(); ready<SapsImage> createdTasks = new LinkedList<SapsImage>(); List<SapsImage> createdTasks = new LinkedList<SapsImage>(); ListapsImage s = = = new SapsImage(""task"", ""1cape"",8_ ""20"","","","","", "" Date( TypeStatus.READD, newapsImage.DEFAULTONE,AVACHBOL_IDOB_ID, """",0, "");"","", ""userorthass "" """");op"", "" ""n"","", "" "" Dateestamp(15 new new Timestamp(1), new """",n STasks.add(task01); ready(imageStore.getImage(Image"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * {@inheritDoc}\\\\n * <p>\\\\n * Overridden to append a JSON representation of the symbol element to the\\\\n * writer provided when this object was created.\\\\n * </p>\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testVisitSymbolWithNonSymbol() { final StringWriter writer = new StringWriter(); final JsonSerializationVisitor visitor = new JsonSerializationVisitor( writer, true); visitor.visitSymbol(""a"", ""1234""); assertEquals(""a : '1234'"", writer.toString()); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public ThislinkheritDoc}nnn */ \p>\This\\n * <ridden to return the newline object of the object to to the result\\n * result. by the element is created.\\\\n * <p>\\\\n *\ ']
### Solution:Unit: the:
sierpTest public public void testAppenditSymbol()outNull() throws Symbol SymbolWriter writer = new StringWriter(); final SymbolGeneratorizableContextitor visitor = new JsonSerializationVisitor(writer writer); ); visitor.visitSymbol(foo"", ""b"");3"");5 assertEquals(""': 1234'"", writer.toString()); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Gets the value of a single-valued property (such as {@link Note}).\\\\n\\\\t * @return the value or empty string if not found\\\\n\\\\t */', '')"", ""('', '//get the first element of the array\\n')""]
### Test JUnit in Java:
","@Test public void asSingle_object() { Map<String, JsonValue> object = new HashMap<>(); object.put(""a"", new JsonValue(""one"")); JCardValue value = new JCardValue(new JsonValue(object)); assertEquals("""", value.asSingle()); }","OOOOOOO everybody################rus (.ow the a example to is the method. property. a.
a method methodav test case.
publicpublic#
The""/n\\\\\\n\\\\ets the value of the property propertyvalued property.a as alink ##\\\\n\\\\t * @return the value of {@ if if the set\\\\n\\\\t *\\ '""] ""\\/** ''),',Note value value of the array\\\\\\"",
### ReturnsUnit: Action:
sierpTest publicpublic void testStringValueget_ { <String, StringValue> map = new HashMap< object.put(""a"", "" JsonArray(""a"")); objectValue card card = object JCardValue(object JValue(""object)); assertEquals(one value.asSingle()); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Create payload identifier for payload params. This is a deterministic hash of all payload\\\\n * parameters that aims to avoid collisions\\\\n *\\\\n * @param parentHash the parent hash\\\\n * @param timestamp the timestamp\\\\n * @param prevRandao the prev randao\\\\n * @param feeRecipient the fee recipient\\\\n * @param withdrawals the withdrawals\\\\n * @param parentBeaconBlockRoot the parent beacon block root\\\\n * @return the payload identifier\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void emptyOptionalAndEmptyListWithdrawalsYieldDifferentHash() { final Bytes32 prevRandao = Bytes32.random(); var idForWithdrawals1 = PayloadIdentifier.forPayloadParams( Hash.ZERO, 1337L, prevRandao, Address.fromHexString(""0x42""), Optional.empty(), Optional.empty()); var idForWithdrawals2 = PayloadIdentifier.forPayloadParams( Hash.ZERO, 1337L, prevRandao, Address.fromHexString(""0x42""), Optional.of(emptyList()), Optional.empty()); assertThat(idForWithdrawals1).isNotEqualTo(idForWithdrawals2); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public This a for for a with.\\ is used helperistic function of the the params\\n * params. are user to be collisions.\\n * between\\n * @param payloadId the parent hash\\\\n * @param payload the timestamp\\\\n * @param payloadHashoundo the previous randao\\\\n * @param payload thecipient the fee recipient\\\\n * @param payloadal the withdrawals\\\\n * @param payloadTchChainRoot the parent beacon block root\\\\n * @param the payload identifier\\\\n */\\ ']
### Inst:Unit: the:
sierpTest public public void testPayPayOptionalPay()drawals()ieldsifferentPayes { Be Betes32 parentRandao = newtes32.from(); final parent =Emptydrawals = = new newloadId.createWithload((new By.ZERO, prev,37,, prevRandao, Col.ZHexString(""0x02""), List.empty(), List.empty(), var idForWithdrawals2 = PayloadIdentifier.forPayloadParams( Hash.ZERO, 1337L, prevRandao, Address.fromHexString(""0x42""), Optional.empty(ListList()), Optional.empty()); assertThat(idForWithdrawals1).isNotEqualTo(idForWithdrawals2); }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Generate the packing instruction suitable for modifying the type associated\\\\n\\\\t * with the given user.\\\\n\\\\t *\\\\n\\\\t * @param userName\\\\n\\\\t * {@code String} with the iRODS user name.\\\\n\\\\t * @param userType\\\\n\\\\t * {@link org.irods.jargon.core.protovalues.UserTypeEnum} value for\\\\n\\\\t * the user.\\\\n\\\\t * @return {@link GeneralAdminInp}\\\\n\\\\t * @throws JargonException\\\\n\\\\t * for iRODS error\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test(expected = JargonException.class) public void testModifyUserTypeNullUser() throws Exception { GeneralAdminInp.instanceForModifyUserType(null, UserTypeEnum.RODS_ADMIN); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\\
\\\\\nn\\\\ated a
ing.or. the the the of withnn\\tn\\\\ the\\\\.
nn\\tn\\\\nn\\\\n\\\\\\\\\\\\nn\\\\t\\\\ \\n}\\
the given.T,,,
nn\\tn\\\\param\\\\.nn\\\\t\\\\ withcode\\\\
..
...j.\\..
...@. thenn\\\\n\\\\ with\\.
nn\\\\n\\\\param\\n\\.. the}nnn\\\\n\\\\\\et.\\on.snn\\\\n\\\\ @ the\\I.;nn\\\\n\\\\@
\\#\.UnitTest the.
## sierp@JJ) expectedUnited))J)
@ static
.ern
.;
Type
.
@ .}n}
ofumify}}.J.null)))User))R)_ "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * @return A clone of this delegate.\\\\n *\\\\n * @throws CloneNotSupportedException if the object cannot be cloned.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testCloning() throws CloneNotSupportedException { XYSeries s1 = new XYSeries(""Series""); s1.add(1.2, 3.4); XYSeriesCollection c1 = new XYSeriesCollection(); c1.addSeries(s1); IntervalXYDelegate d1 = new IntervalXYDelegate(c1); IntervalXYDelegate d2 = (IntervalXYDelegate) d1.clone(); assertNotSame(d1, d2); assertSame(d1.getClass(), d2.getClass()); assertEquals(d1, d2); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: anor
:
of a that the,
a
to....
TheThe#
:
##\\
\\\\\ =
\
.. the..
nn\\ *
nn\\ *\\returnese.os.esing bys
. be aoned.
nn\\ *
#####\\.
the.
## sierp@J *
one
aone.esing,s
@}}},, X YYZ1X"");
X1,
itionals)s)11)1)
sYZ4 of.. X XYZ c c
X1.
(ClX,.
XviewsZ,., newXvalsZeX),
XvalsZ)1) newX)Z) 2.1(
X false,ame;s))d1)
XNotameDed1,d))d1)d))
XNot(d1,d1, X
Y"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(\'/**\\\\n\\\\t * \\\\n\\\\t * @param siteId - PropertyID\\\\n\\\\t * @param mediaId - Unique alphanumeric ID of the media\\\\n\\\\t * @param bodyParams - Parameters to be included in the request body\\\\n\\\\t * @return JSON response from Media API\\\\n\\\\t * @throws JWPlatformException See <a href=\\\\n\\\\t * ""https://developer.jwplayer.com/jwplayer/reference#put_v2-sites-site-id-media-media-id-reupload"">\\\\n\\\\t * Re-Upload Media</a>\\\\n\\\\t */\', \'\')']
### Test JUnit in Java:
","@Test public void testReupload() throws JWPlatformException { mockStatic(HttpCalls.class); JSONObject expected = new JSONObject(); expected.append(""key"", ""value""); when(HttpCalls.request(anyString(), anyMap(), anyBoolean(), eq(""PUT""), anyMap())).thenReturn(expected); JSONObject actual = mediaClient.reuploadMedia(""siteId"", ""ajhsbjdsha"", new HashMap<>()); assertEquals(expected, actual); PowerMockito.verifyStatic(HttpCalls.class, Mockito.times(1)); HttpCalls.request(anyString(), anyMap(), anyBoolean(), eq(""PUT""), anyMap()); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Testn +\\\\\\\\\t\\\\\\\t\\\\t * \param \ \ \ \ The site of\\n\\\\t * @param siteType - Mediaique IDphanumeric identifier of the media\\\\n\\\\t * @param media Bodyeters to be passed in the body\\\\\\n\\\\t * @param - response\\ the API\\\\n\\\\t * @throws APIsTAException - Ja href=""\\\\""\\\\t * \ \https://developers.jwplatform.com/referencew-/reference/errors-media1_media-media-media-media-id-id-bodyqu-J\\n\\\\t * Juploadupload</</a> for\\n\\\\t */\\n '\\n]
### Ex:Unit: the:
sierpTest publicpublic void testReUploadMedia throws JWPlayerException { StringMvc(JClientli.class); HttpObject json = new JSONObject(); expected.put(""id"", ""value""); expected(HttpCalls.put(any(),(), anyString(), anyString()) any(application""), anyString(),).thenReturn(expected); JSONObject actual = jApi.reupload((siteId"", ""mediasdf"","","", null HashMap<()); assertEquals(expected, actual); }}Mockito.verifyStatic(anyCalls.class); timesito.times(1)); Calls.request(anyString(), anyMap(), anyBoolean(), eq(""PUT""), anyMap()); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Checks the form object for any inconsistencies/errors\\\\n\\\\t * \\\\n\\\\t * @see org.springframework.validation.Validator#validate(java.lang.Object,\\\\n\\\\t * org.springframework.validation.Errors)\\\\n\\\\t * @should fail validation if personMergeLogData is null\\\\n\\\\t * @should fail validation if winner is null \\\\n\\\\t * @should fail validation if loser is null \\\\n\\\\t * @should pass validation if all fields are correct\\\\n\\\\t * @should pass validation if field lengths are correct\\\\n\\\\t * @should fail validation if field lengths are not correct\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test public void validate_shouldFailValidationIfLoserIsNull() throws Exception { PersonMergeLog personMergeLog = new PersonMergeLog(); personMergeLog.setWinner(new Person()); personMergeLog.setPersonMergeLogData(new PersonMergeLogData()); PersonMergeLogValidator validator = new PersonMergeLogValidator(); Errors errors = new BindException(personMergeLog, ""personMergeLog""); validator.validate(personMergeLog, errors); Assert.assertTrue(errors.hasFieldErrors(""loser"")); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thiss if methodatter is a errorsistencies.errors.\\n\\\\t */ @\\nn\\\\t * @param Form.apache.web.Errors\\validate(Object.lang.Object, org\\n\\\\t * java java.springframework.validation.Data)\\n\\\\t * @see\\ validation if the isged isic is null\\\\n\\\\t * @should fail validation if person is null\\\\\n\\\\t * @should fail validation if winnerer is null \\\\n\\\\t * @should fail validation if winner fields are valid\\\\n\\\\t * @should pass validation if all is are correct\\\\n\\\\t * @should pass validation if field lengths are incorrect correct\\\\n\\\\t *\\ '""]
### Ex:Unit: Action:
sierpTest publicpublic void test_should_ValidationIfPersonoserIsNull() throws Exception { PersonMergeLogDataMergeLog = new PersonMergeLog(); personMergeLog.setLinner(null Person()); personMergeLog.setLMergeLogData(null PersonMergeLogData()); personMergeLogData validator = new PersonMergeLogValidator(); List errors = new DefaultException(personMergeLog, ""personMergeLog""); assertator.validate(personMergeLog, errors); assert.assertTrue(errors.hasErrorsErrors(""personer"")); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Receives two integer arrays representing two words and calculates the Block distance.\\\\n\\\\t * @param str1 integer array number 1.\\\\n\\\\t * @param str2 integer array number 2.\\\\n\\\\t * @return The Block distance.\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test //jdsalazar public void test2(){ String str1 = ""Test String 1""; String str2 = ""Test String 2""; double res = Block.distance(str1,str2); Asserts.assertEquals(res, 0.666666667); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\
\\\\\\\n\\\\ived\\\\;, the.. threeates two
s.
nn\\nn\\\\\\etut\\\\1,1.
nn\\tt\\\\\\\\\\\\\\.,1.
nn\\tt\\\\param\\ Block..
nn\\tn\\\\@\\
\###\\.
. the.
\\ sierpparamJ@@\\.
\\\\\\ .@@@ ut0 StringString""220 StringString22 TestTest"" 1; StringString er double
. ,,str2) doubleStringg1
s) ,str2,1)))...666 As \\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Generate the packing instruction suitable for removing a user from iRODS.\\\\n\\\\t *\\\\n\\\\t * @param userName\\\\n\\\\t * {@code String} with the iRODS user name to be removed.\\\\n\\\\t * @return {@link GeneralAdminInp}\\\\n\\\\t * @throws JargonException\\\\n\\\\t * for iRODS error\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test public void testRmUserCheckXML() throws Exception { String testUserName = ""testUser""; GeneralAdminInp pi = GeneralAdminInp.instanceForDeleteUser(testUserName); String tagOut = pi.getParsedTags(); StringBuilder sb = new StringBuilder(); sb.append(""<generalAdminInp_PI><arg0>rm</arg0>\n""); sb.append(""<arg1>user</arg1>\n""); sb.append(""<arg2>testUser</arg2>\n""); sb.append(""<arg3></arg3>\n""); sb.append(""<arg4></arg4>\n""); sb.append(""<arg5></arg5>\n""); sb.append(""<arg6></arg6>\n""); sb.append(""<arg7></arg7>\n""); sb.append(""<arg8></arg8>\n""); sb.append(""<arg9></arg9>\n""); sb.append(""</generalAdminInp_PI>\n""); Assert.assertEquals(""unexpected XML protocol result"", sb.toString","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thisate a randomed list for for the the box from aTDS.\\\\n\\\\t *\\\\n\\\\t * @param userName The\\t\\\\t * @ Thelink String} the the nameRODS user name to remove removed.\\\\n\\\\t * @param\\code StringInstistrationstr}\\\n\\\\t * throws GeneralROonException\\\\n\\\\t * if anyRODS errors.\\n\\\\t *\\ '""]
### Inst:Unit:p:
sierpTest publicpublic void testRemovemUser()()() throws J { String[]XML = ""testUser""; StringAdminInp general = newAdminInp.create(RUser(testUserName); pi xml = = pi.toTagarsedXML(); assert xml sb = new StringBuilder(); sb.append(""rmAdminInp>\rm>user0>"");</arg0><n""); sb.append(""<arg1>"");</arg1>\n""); sb.append(""<arg2>testUser</arg2>\n""); sb.append(""arg3>arg3>\n""); sb.append(""arg4></arg4>\n""); sb.append(""<arg5></arg5>\n""); sb.append(""<arg6></arg6>\n""); sb.append(""<arg7></arg7>\n""); sb.append(""<arg8></arg8>\n""); sb.append(""<arg9></arg9>\n""); sb.append(""<</generalAdminInp_PI>\n""); String.assertEquals("",expected tag"","","", sb.toString(),"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Registers an unconditional parent with this builder. If the parent is already registered with this builder,\\\\n * {@link IllegalArgumentException} is thrown.\\\\n * @param parent The node that will be the parent of the built action.\\\\n * @return This builder.\\\\n *\\\\n * @throws IllegalArgumentException if the provided node is already registered as a parent.\\\\n */', '')""]
### Test JUnit in Java:
",@Test public void testAddingDuplicateParentBothTimesWithoutConditionThrows() { final N parent = getBuilderInstance().build(); final B builder = getBuilderInstance(); builder.withParent(parent); expectedException.expect(IllegalArgumentException.class); builder.withParent(parent); },"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##\\'/\\\\ \\
ed\\
belitional
h the..
you
. a.. this.. thenn\\ *\\t\\legal\\,s
a.
nn\\ *\\\\eter\\ parent is the be a parent. the parent..
nn\\ *\\\\\\ is.
nn\\ *\\nn\\ *\\\\ese\\legal.\\\\ the parent.. a. with the method.\\nn\\ *\\\\\\\\\\\\#\\s., the\\\\\\ sierp\\J *\\\\.itional..,,,illers, theside,ese,@\\ @}}, false a,J
ings
*N.. Bter..
final;
..b, *;;
snlegal,))
)
Il.
..n. *\\\\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Create a dataObjInp for a mounted filesystem\\\\n\\\\t *\\\\n\\\\t * @param localFileSystemAbsolutePath\\\\n\\\\t * {@code String} with a local filesystem absolute path\\\\n\\\\t * @param irodsMountedCollectionAbsolutePath\\\\n\\\\t * {@code String} with the irods collection to be mounted\\\\n\\\\t * @param destRescName\\\\n\\\\t * {@code String} with the storage resource\\\\n\\\\t * @return {@link DataObjInpForMcoll}\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test(expected = IllegalArgumentException.class) public final void testInstanceForFileSystemMountBlankIrods() throws Exception { String localFile = ""xxx""; String mount = """"; String resc = ""resc""; DataObjInpForMcoll.instanceForFileSystemMount(localFile, mount, resc); }","OOOOOOOOOOOOOOOOOOOOO sierp$ru: 1ow, the acceptable ( tells how process of a. a.
a method codeSP...
The
# :
\_/n""""]""""\\/ a new class. the. data data..\\\\\\tt * Create\\n\\\\t *\\Data param
straPath
nn\\\\t *\\ @liter}[]
the dataFile
path
\\n\\\\t *\\param local
s\\edFile
solutePath\\\\n\\\\t *\\ {@code String}
a correspondingrodsMount absolute the absolute\\\\n\\tt * @param iropectaled\\nn\\\\t * {@code String} with the dest absolute\\\\n\\\\t * param Stringcode String}}p}At}nnn\\\\t *
#
Unit test Java
sierpTest
expected= legalArgumentException.class)
@ void void test0()All()()edind()rods()
Il {
[]FileSystem ""file""; if local = "" String[] =Name ""xxxc""; StringFInpForMcoll localtestForFileSystemMountBllocalFile, mount, resc);
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Verilen de\\\\xc3\\\\x84\\\\xc5\\\\xb8eri ayn\\\\xc3\\\\x84\\\\xc2\\\\xb1 birim olmak \\\\xc3\\\\x83\\\\xc2\\\\xbczere ekler\\\\n * \\\\n * @param base\\\\n * @param amount\\\\n * @return \\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testAdd4() throws UnitException { System.out.println(""add4""); QuantitativeAmount q1 = new QuantitativeAmount(BigDecimal.TEN, MassUnitSet.GRAM); QuantitativeAmount q2 = new QuantitativeAmount(new BigDecimal(100), MassUnitSet.DECIGRAM); QuantitativeAmount expResult = new QuantitativeAmount( new BigDecimal(2000), MassUnitSet.CENTIGRAM); QuantitativeAmount result = Quantities.add(q1, q2, MassUnitSet.CENTIGRAM); assertEquals(expResult, result); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisifies birğ\\n3\\xaxb3er\\xc3\\\\x91\\\\\\\\\\xc3\\\\x84\\\\xc5\\\\x94\\ dedemasak z\\\xc3\\\\xb4\\\\xc2\\\\xb7\\ gley.\\xc * \\\\xc * @param de The\\n * @return de\\\\n * @return\\\\\n *\ '""]
### InstsUnit: Action:
sierpTest public public void testAdd()() { ExceptionTest { int.out.println(""Add4""); assertityTest<a = new QuantitativeAmount(4Decimal.valueOfEN, ""Unit..GRAM); QuantitativeAmount q2 = new QuantitativeAmount(Big BigDecimal(""100), MassUnitSet.GCIIGRAM); QuantitativeAmount qResult = new QuantitativeAmount(new BigDecimal(100),), MassUnitSet.DEENTIGRAM); QuantitativeAmount result = qitative.add(q1, q2); MassUnitSet.CENTIGRAM); assertEquals(expResult, result); }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(""/**\\\\n * This method is used to get password of the KeyServer HTTPS certificate \\\\n * manager.\\\\n * @return String with the KeyServer HTTPS certificate password. If the \\\\n * field is not present, returns \'null\'.\\\\n * @since v0.4.0\\\\n */"", \'\')', ""('', '// Error level.\\n')""]
### Test JUnit in Java:
","@Test public void testGetServerKeyManagerPassword2() { System.out.println(""getServerKeyManagerPassword2""); String result = testObj3.getServerKeyManagerPassword(); assertNull(result); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow::
or
:
of a that the,
a
to....
TheThe#
:
##t\//\\\\ \\
is is an to
the. the
word.Sever.\\nn\ *
.
nn\\ *\\\\\\. the Keyword.S...
you Keynnn\\ *\\ *. used used. the thens\n
nn\\ *\\return\..
.
.nn\\ *\\ ""nn@ \\\\\ ""\\\s.
n\\@\\\\\... the.
\ sierp\\J *\\\.ting...,.@\\ \.
.
.System"","","","","","",
*Key = null.;.java;Key... \ that,String)
\@\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// First create replication agent on previewPublish instance\\n')"", ""('', '// Find unpaired previewPublish dispatcher and pair it with tags\\n')"", ""('', '// Create a new previewPublish from a snapshot of an active previewPublish instance\\n')""]
### Test JUnit in Java:
","@Test public void testWithNullVolumeId() throws Exception { when(awsHelperService.getVolumeId(activePreviewPublishId, awsDeviceName)).thenReturn(null); boolean result = action.execute(instanceId); verify(aemHelperService, times(1)).pairPreviewPublishWithDispatcher(instanceId, unpairedDispatcherId); verify(replicationAgentManager, times(1)).createPreviewReplicationAgent(instanceId, PreviewPublishAemBaseUrl, authorAemBaseUrl, AgentRunMode.PREVIEWPUBLISH); verify(replicationAgentManager, times(1)).pausePreviewReplicationAgent(activePreviewPublishId, authorAemBaseUrl, AgentRunMode.PREVIEWPUBLISH); verify(aemHelperService, times(0)).tagInstanceWithSnapshotId(instanceId, snapshotId); verify(replicationAgentManager, times(1)).resumePreviewReplicationAgent(activePreviewPublishId, authorAemBaseUrl, AgentRunMode.PREVIEWPUBLISH); assertThat(result","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test] ')'', line aorter group') the serverlisher.n\\""]
['', '// Then thepubired repPublish\\er\\ create it with rep\\n')"", ""('', '// Find a new repPublish instance the rep of the existing publishPublish\\\\n')"",
### Ex:Unit: the:
sierpTest public public void testCreateoutPre()() throws Exception { final(mockMock.MockgetVolumeId(anyPubviewPublish)).)). nullHelper)).)).thenReturn(null); when result = preview.execute();awsId, assert(awserClientService). times(1)).createPreviewPublishWithTags(eqId, activepairedPreId, verify(alicationHelperService, times(1)).createRepviewPublicationAgent(eqId, unviewReplish.wsHelper.. un unizeremUserUrl, TypeAs.NVIEW_BLISH, verify(replicationAgentManager, times(1)).createausePreviewReplicationAgent(instancePreviewPublishId); PreAemBaseUrl, Agent AgentRunMode.PREVIEWPUBLISH); verify(repemHelperService, times(1)).pairPre(PreId(instanceId, snapshotId); verify(alicationAgentManager, times(1)).createumePreviewReplicationAgent(activePreviewPublishId, authorAemBaseUrl, AgentRunMode.PREVIEWPUBLISH); verifyThat(result,"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Returns a new builder.\\\\n * @param <T> the data type\\\\n * @param dataType the data type\\\\n * @return the created builder\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void output() throws Exception { RecordDefinition<String[]> def = RecordDefinition.builder(String[].class) .withField(self(), field(0).build()) .build(); String[][] results = emit(def, new String[][] { { ""Hello, world!"", }, }); assertThat(results, is(new String[][] { { ""Hello, world!"", }, })); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow::
or
:
of a
the:
a
to...
TheBel#
:
##\\//\\\\ is
the method
.
nn\\ *\\\\\\\\>
. ofnn\\ *\\\\\\\\\\ data\\\\nn\\ *\\\\\\ data\\\\nn\\ *@\\\\\\\\\\\\\\ing\\
the\\
\\ sierp\\@ *\\\\
@ as@ @, of@>>@n null<<
,n,J
,J public@draw<String, .self)
ings .ners
.,@ .. (String) ,)[][]@ .@ "". "",
"" "" ""
.,,b,{,1,)););@ .@Hello, world}}, "" "" ""
"" ,"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/*\\\\n\\\\t * (non-Javadoc)\\\\n\\\\t *\\\\n\\\\t * @see org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO#\\\\n\\\\t * getFullObjectForType(java.lang.String)\\\\n\\\\t */', '')"", ""('/*\\n\\t\\t * See if jargon supports the given object type\\n\\t\\t */', '')"", ""('', '// see if file or coll\\n')"", ""('/*\\n\\t\\t * objStat: absolutePath:/test1/home/test1/jargon-scratch/\\n\\t\\t * CollectionAndDataObjectListAndSearchAOImplForMSSOTest\\n\\t\\t * /testGetFullObjectForTypeInTestWorkflow\\n\\t\\t * /testGetFullObjectForTypeInTestWorkflowMounted/e","@Test public void testGetFullObjectForTypeDataObjectEmbeddedPlusAndSpacesInDataName() throws Exception { String testCollName = ""2003_01_26_02 + band""; String testFileName = ""106-0653_IMG.JPG""; String absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH); String fileNameOrig = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 2); String targetIrodsCollection = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties( testingProperties, IRODS_TEST_SUBDIR_PATH + ""/"" + testCollName); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); DataObjectAOImpl dataObjectAO = (DataObjectAOImpl) irodsFileSystem.getIRODSAccessObjectFactory() .getDataObjectAO(irods","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
s\\\\\\t\\\\\\-staticavadoc)\\n\\\\t * (\\n\\\\t * (Test\\.apacheds.jvmon.core.J.J#FileType#ingData.ware.get\\n\\\\t * getCollectionPathPathSearch(java.lang.String,\\n\\\\t *\\ '""] ""public/*\\\\\\t *t * ( also theargon. the get type type.t\\t */t */"", '')"", ""('/* '')\\\\ if j type folder typen\\"", ""('',\\n\\t\\t * (Type\\ object path\\path/\\test/test1/testargon/testatch/testn\\t\\t * objAndDataObjectListAndSearchAO::Testys:est.n\\t\\t */ \\test1FullObjectForType\\M\\space\\n\\t\\t * /testGetFullObjectForTypeInTestWorkflow/ed\\\\:\\ sierpsee\\public void testGetFullObjectForTypeInObject()beddedInFilePlusaces()PathObject() throws Exception { String absoluteFull = = ""test019001_00_19_ width String testData = ""200400---0G_JPG""; String testPath = ""Dir..getAbGetAbsolutePathratchFile(testRODS_HOME_WORMIT,NAME, String test =ig = absUtils.getFileName(TypeSize(ivenFileName(testPath, testFileName, 10 String fileNameFileNameROsPath = ""Utils..getTargetrodDSCollectionNamesolutePath(TestProperties(test PropertiesHelper RODS_TEST_SUBDIR_PATH, ""/"" + testCollName); StringRODSFile irodsAccount = newPropertiesHelper.getIRODSAccountFromTestProperties( Properties, IObject dataO data dataObjectAO = newDataObjectAOImpl) irodsAccountSystem.getDataRODSAccountObject((). getDataObjectAO(irodsAccount"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Received two double vectors and calculates the Chi distance.\\\\n\\\\t * @param v1 vector number 1.\\\\n\\\\t * @param v2 vector number 2.\\\\n\\\\t * @return The Chi distance.\\\\n\\\\t */', '')"", ""('', '//casting (double) a v1.length\\n')""]
### Test JUnit in Java:
","@Test // jdsalazar public void test03() { double[] v1 = new double[] {8,3,4}; double[] v2 = new double[] {6,5,10}; Asserts.assertEqualLength(v1, v2); Asserts.assertGreaterThanZero(v1); Asserts.assertGreaterThanZero(v2); double res = Chi.distance(v1, v2); Asserts.assertEquals(res, 0.5263882104539921); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thisive: integers values and returnsates the dot- between\\\\n\\\\t * @param v1\\ 1\\\\\\n\\\\t * @param v2 vector number 2.\\\\n\\\\t * @return the Chi distance.\\\\n\\\\t *\\ '] ""public/** 'public Chi the the\\) to vector1 vector\\()\\\\"",
### Inst:Unit: the:
sierpTest publicpubliccastUnit.v // void testCh1() { double[] v1 = new double[] { . ,1, double[] v2 = new double[] {1,2,7};}; assertserts.assertEquals((v1, v2); Asserts.assertEqualaterThan((v1. Asserts.assertGreaterThanZero(v2); As[] = ChiDistancedistance(v1, v2); As serts.assertEqual(1, 1.0);63689733333655, }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Generates a po file from a Resource and a TranslationsResource, using the\\\\n * publican directory layout.\\\\n *\\\\n * @param baseDir\\\\n * @param doc\\\\n * @param locale\\\\n * @param targetDoc\\\\n * @throws IOException\\\\n */', '')"", ""('', '// write the PO file to $locale/$name.po\\n')""]
### Test JUnit in Java:
","@Test public void writeWithDefaultOptions() throws Exception { // given writer = new PoWriter2.Builder().create(); Resource srcDoc = createDoc(); TranslationsResource doc = createTranslations(); ByteArrayOutputStream out = new ByteArrayOutputStream(); // when writer.writePo(out, UTF_8, srcDoc, doc); // then String result = out.toString(UTF_8); assertThat(result).isEqualTo(contentOfResource(""writeWithDefaultOptions.po"")); }","OOOOOOOOOOOOOOOOO sierp##ru: 1ow, the acceptable ( tells how process of a. a.
a method codeSPTest..
Write
# :
\test/n\\\\ * ated a newjo. the string. a Resourceactionator..
a samenn * Gener static instruction from.
\\n * public\\n *\\param paramDir
\\\\ * publicparam baseBase\\\\ * @param dir\\\\\\ * @param langDir\\\\n * @paramrows\\\\\\\\ *
\\/** '/**', the correspondingJ from the1\\base',po.\\ "",
# sUnit test Java
public sierpTest
public void testTooutEncoding() throws IOException {
} Gener
// = new Fileinter((1();with();
// r = = newResource(); ResourcelationsResource tr = createDoclationsResource docArrayOutputStream out = new ByteArrayOutputStream(); out when out.write((src); src88); srcDoc, doc); // then out s = out.toString(""UTF_8); assertEquals(result,isEqualTo(""src);File);testWithDefaultOptions.po"")); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(\'/**\\\\n * Trims the leading/trailing classical whitespace characters in the {@link StringOption}.\\\\n * This only removes the following characters:\\\\n * <ul>\\\\n * <li> {@code ""\\\\\\\\t"" (HT:U+0009)} </li>\\\\n * <li> {@code ""\\\\\\\\n"" (LF:U+000a)} </li>\\\\n * <li> {@code ""\\\\\\\\r"" (CR:U+000d)} </li>\\\\n * <li> {@code "" "" (SP:U+0020)} </li>\\\\n * </ul>\\\\n * This directly modifies the target {@link StringOption}.\\\\n * @param option the target {@link StringOption}\\\\n * @throws NullPointerException if the {@link StringOption} is/re","@Test public void trim_rounding() { StringOption value = new StringOption("" Hello, world! ""); StringOptionUtil.trim(value); assertThat(value, is(new StringOption(""Hello, world!""))); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Testn +\\\\\\\ *\\im the given andtrailing spaces whitespace from from a givenlink String}}\\\n * @ method works the leading characters:\\n * \\ul>\\\\n * <li>\\link \ ""tttt""}}\\tab)} )}0009)}</li> <\\n * <li> {@code ""\\\\\\\\n"" (HTF:U+000A)} </li>\\\\n * <li> {@code ""\\\\\\\\r"" (CR:U+000d)} </li>\\\\n * <li> {@code ""\\ (SP:U+0020)} </li>\\\\n * <ul>\\\\n * < method modifies the {@ {@link StringOption}.\\\\n * <param option the {@ {@link StringOption}\\\n * @returnrows IlPointerException if the targetlink StringOption} is {@wasferences sierpreturn\ public void testLleading__ { StringOption option = new StringOption(""\\ \ World World! ""); StringOption result.trim(value); assertEquals(value. is(""new StringOption(""Hello, world!""))); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Returns the version information\\\\n\\\\t *\\\\n\\\\t * @return the version information\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test public void testVersion() { String version = Platform.getVersion().getVersionNumber(); Pattern pattern = Pattern.compile(""^(\\d+\\.\\d+\\.\\d+)(-.*)$""); Matcher matcher = pattern.matcher(version); assertTrue(matcher.matches(), ""Unexpected format for :"" + version); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow: a anor
:
of a that the,
a
to....
TheThe#
:
##\\
\\\\\\\n\\\\ the
of in\\n\\tn\\\\nn\\\\n\\\\\\\\\\\\\\nn\\tt\\
#####\\.
the
## sierp@J@
public
publicpublic @ String.public()()getVersion()()
@@s, .Pattern J""""n"","",ttt+"",ttt+\\.\\)@ \Pattern.,er, match,
er,b) PatternPatternion) er,t)\\\"","""","", a \ "", Match \"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * {@inheritDoc}\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void hashCodeOfDifferentModificationDate() { // given ObjectInfo objectInfo1 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX_HEIGHT, IMAGE_PIX_WIDTH, IMAGE_PIX_HEIGHT, IMAGE_BIT_DEPTH, PARENT_OBJECT, ASSOCIATION_TYPE, ASSOCIATION_DESC, SEQUENCE_NUMBER, FILE_NAME, CAPTURE_DATE, ""foo"", KEYWORDS); ObjectInfo objectInfo2 = new ObjectInfo(STORAGE_ID, OBJECT_FORMAT, PROTECTION_STATUS, OBJECT_COMPRESSED_SIZE, THUMB_FORMAT, THUMB_COMPRESSED_SIZE, THUMB_PIX_WIDTH, THUMB_PIX_HE","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp ru of Theow. a Americanal
the
of a that a.
a first.....
TheThe# #: TheThe\J*nn\\ =//linkheritant}nnn{ *
\\# \s
Java
## sierp@
public static
ifiers
public
//[]}}}} Object ObjectInfo1Object)))1)STT)_ID)) OPERX_ID) OB__FORMLEULT,,ID, O OROWB,SIZE,, OUMB_SIZERES_D_SIZE, OUMB_FORME,SIZE, THUMB_PIX_SIZEIGHT, TH THTERSK_HEX_HE, IMAGE_PIX_WIDTHIGHT, THMAGE_PI,WIDTHSCTH, IAGEENTHHEJECT_ P THGE_,,_OB, OSSOCIA_SIZESC, ACTIONENCE_DE, SE_NUMBER, FILE ALATIT_NUMBER, C
"" ""_DS,
publicInfo
Info;; null ObjectInfo2STORAGE_ID, OBJECT_IDAT, PROTECTION_STATUS, OBJECT_FORMRESSED_SIZE, O THUMB_PIAT, THUMB_PIRESSED_SIZE, THUMB_PIX_HE, THUMB_PIX_HEIGHT"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(""/**\\\\n\\\\t * Generate the packing instruction suitable for adding the given user to iRODS.\\\\n\\\\t * <p>\\\\n\\\\t * Note that the user DN is not updated in this call, as there appears to be bug\\\\n\\\\t * where it gets truncated. The {@code UserAO} methods will instead add a call\\\\n\\\\t * to the equivalent of \'iadmin aua\' to insert the user DN. See comments for\\\\n\\\\t * that class.\\\\n\\\\t *\\\\n\\\\t * @param user\\\\n\\\\t * {@link org.irods.jargon.core.pub.domain.User} to be added to\\\\n\\\\t * iRODS.\\\\n\\\\t * @return {@link GeneralAdminInp}\\\\n\\\\t * @throws JargonException\\\\n\\","@Test public void testAddUserCheckAPIType() throws Exception { User user = new User(); user.setName(""test""); user.setUserDN(""dn""); user.setUserType(UserTypeEnum.RODS_USER); GeneralAdminInp pi = GeneralAdminInp.instanceForAddUser(user); Assert.assertEquals(""incorrect api type"", GeneralAdminInp.GEN_ADMIN_INP_API_NBR, pi.getApiNumber()); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Testa""*\\""\\t\\\\ate a followinged list for for a to item item to theTDS.\\\\n\\\\t * @p>\\\\t\\\\t * @: the user isN is not included in the method. so it is to be no in\\n\\\\t * in the is updatedated.\\ userlink user}ud} class are update update the new to\\n\\\\t * to {@ {@ method {@\\addRO\p add to update the user.N.\\ the in more\\n\\\\t * more method.\\\\n\\\\t * <\\n\\\\t * <param user the\\n\\\\t * The Thecode User.irods.jargon.core.user.User.User} to add added to i\\n\\\\t * iRODS.\\\\n\\\\t * @return\\link StringPackistrstr}\\\n\\\\t * @throws GeneralargonException if\\n\\\\ sierpth\public void addAddUser()s()() throws J { GeneralA = new User(); user.setName(""test""); user.setTypeDN(""test""); user.setUserType(UserType..USERDS_USER); GeneralAdminInp in = newAdminInp.builder(AddUser(user); assert.assertEquals(ROp type type"", piAdminInp.APIERADMIN_INP_TYPE_TYPEONE, pi.getApiType()); "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Loads all tags from writers in configuration.\\\\n\\\\t *\\\\n\\\\t * @return Found tags\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test public void multipleWritersWithTags() { Configuration.set(""writer1"", ""console""); Configuration.set(""writer1.tag"", ""system""); Configuration.set(""writer2"", ""console""); Configuration.set(""writer2.tag"", ""technical""); Configuration.set(""writer3"", ""console""); Configuration.set(""writer3.tag"", ""system""); List<String> tags = ConfigurationParser.getTags(); assertThat(tags).containsExactlyInAnyOrder(""system"", ""technical""); }","OOOOOOOOOOOOOOOOOO sierp##ru: 1ow, the acceptable ( tells how process of a. a.
a method codeSPTest..
The
# :
\test/n\\
""n\\//ading of the. the. the.
n\\\\\\t * Lo\\\\\\\\t *\\param \ from\\\\\\\\t *
""
# DescriptionsUnit test Java
sierpreturn
public void test()rites(in() {
cgetWwrit"","", ""writer""); Configuration.set(""writer2"",tag"", ""console""); Configuration.set(""writer2"", ""console""); Configuration.set(""writer2.tag"", ""systemology""); Configuration.set(""writer3"", ""console""); Configuration.set(""writer3.tag"", ""techn""); Configuration<String> tags = new..getTags(); ConfigurationThat(tags).containsExactlyInAnyOrder(system"", ""technical"");
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Received two binary vectors and calculates the Forbes distance.\\\\n\\\\t * @param v1 binary vector number 1.\\\\n\\\\t * @param v2 binary vector number 2.\\\\n\\\\t * @return The Forbes distance.\\\\n\\\\t */', '')""]
### Test JUnit in Java:
","@Test //jdsalazar public void test3(){ int[] v1 = new int[]{1,0,1,1,0}; int[] v2 = new int[]{1,1,0,1,1}; Asserts.assertEqualLength(v1, v2); double res = Forbes.distance(v1, v2); Asserts.assertEquals(res, 0.166666666); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thisive: integers numbers of returnsates the dotward- between\\\\n\\\\t * @param v1\\ vector\\ 1\\\\\\n\\\\t * @param v2 binary vector number 2.\\\\n\\\\t * @return the Forbes distance.\\\\n\\\\t */\\ ']
### Solution:Unit: the:
sierpTest publicpublic@oda-v@public void testFor() double[] v1 = { int[]1,2,1,0,1, int[] v2 = new int[]{1,1,0,1,1}; intymts.assertEquals((v1, v2); As distance = Forbes.distance(v1, v2); Asserts.assertEqual(0, 0.0266666666 }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * validate the input document collection. Note that this method call is NOT thread safe. RedPen instances need to be crated for each thread.\\\\n *\\\\n * @param documents input document collection generated by Parser\\\\n * @return list of validation errors\\\\n */', '')""]
### Test JUnit in Java:
","@Test void testDocumentWithoutContent() throws RedPenException { List<Document> documents = new ArrayList<>(); documents.add(Document.builder() .setFileName(""tested file"") .build()); RedPen redPen = getRedPenWithSentenceValidator(); List<ValidationError> errors = redPen.validate(documents).get(documents.get(0)); // validate the errors assertEquals(0, errors.size()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\\
\\\\\ =
_ J text..
: the is.. a NULL..
ditill.. to be aushed. the other.
nn\\ *\\nn\\ *\\cr{. text.. by theagraphann\\ *\\param\\ of the..nn\\ *
#
.
the.
## sierp@J @
.out
.
irectill,s
@<T>}. null List<
List;
itional
)add,){ Listadd))"",."");"");} .setings
.Pillough;ill
new;Petetoutetsities..
.<Test>>
; newset;
.Documents)
;documents.get)document0
List.( data; // false(document)0)
)
//
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Gets the model the editor should edit.\\\\n *\\\\n * @return The editors model.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testReadWithInvisible() { EasyMockSupport support = new EasyMockSupport(); PreferencesImpl prefs = new PreferencesImpl(FeatureActionsRegistry.class.getName()); PreferencesRegistry prefsRegistry = createPrefsRegistry(support, prefs); support.replayAll(); FeatureActions actions = new FeatureActions(); actions.getActions().add(createAction1()); actions.getActions().add(createAction2()); FeatureAction invisible = createAction2(); invisible.setVisible(false); actions.getActions().add(invisible); prefs.putJAXBObject(ourLayerId, actions, false, this); FeatureActionsRegistry registry = new FeatureActionsRegistry(prefsRegistry); FeatureActionEditController controller = new FeatureActionEditController(registry, ourLayerId); assertEquals(ourGroupName, controller.getModel().getFeatureGroups().get(0).getGroupName()); assertEquals(2, controller.getModel().getFeatureGroups().get(0).getActions().size()); assertEquals(FXUtilities.fromAwtColor(","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisets the value of user is edit.\\\\n * @\\n * @return the model model model.\\\\n */"" ']
### Inst:Unit: the:
sierpTest public public void testGet()outcompleteModel throws { finalObjectMock.. = new EasyMockSupport(); supportferences pre prefs = new PreferencesImpl();support...get,get(), preferencesImpl registryfsRegistry = newPrefsRegistry(p); prefs); pre.replayAll(); FeatureActionsRegistry = new FeatureActions( actions.setIn().put(newAction(()); actions.getActions().add(createAction2()); actionsatureActionsRegistryAction createIn3(); invisible.setIn(false); actions.setActions().add(invisible); Fefs.set(B((FeatureFeature,, actions); true); false. preatureActionsRegistry registry = new FeatureActionsRegistry(prefsRegistry); FeatureActionsRegistrying controller = new FeatureActionEditController(registry, ourLayerId); controllerEquals(actionsLayerId, controller.getGroup().getGroupActions().get(0).getNameGroupName()); assertEquals(our, controller.getModel().getFeatureActions().size(0).getActions().size()); assertEquals(1Action..getStringwt((Color"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Give id to each expression. Will be useful if we serialize.\\\\n */', '')"", ""('', '//ensure class analyzer. We need to know observables at this point\\n')"", ""('', '// observables gets initial ids\\n')"", ""('', '// non-observable identifiers gets next ids\\n')"", ""('', '// descendants of observables gets following ids\\n')"", ""('', '// already has some id, means observable\\n')"", ""('', '// only fields earn an id\\n')"", ""('', '// now all 2-way bound view fields\\n')"", ""('', '// non-dynamic binding expressions receive some ids so that they can be invalidated\\n')"", '(\'\', ""// we don\'t assign ids to constant binding expressions because now invalidateAll has its own\\n"")', ""('', '// flag.\\n')"", ""('', '// make sure all","@Test public void testStaticMethodOfInstance() { MockLayoutBinder lb = new MockLayoutBinder(); mExprModel = lb.getModel(); lb.addVariable(""user"", User.class.getCanonicalName(), null); MethodCallExpr methodCall = parse(lb, ""user.ourStaticMethod()"", MethodCallExpr.class); assertTrue(methodCall.isDynamic()); mExprModel.seal(); final Expr child = methodCall.getTarget(); assertTrue(child instanceof StaticIdentifierExpr); StaticIdentifierExpr id = (StaticIdentifierExpr) child; assertEquals(id.getResolvedType().getCanonicalName(), User.class.getCanonicalName()); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public This the to the element.\\ be used for we want the\\\\n *"" '] ""public/** '\\', that iszer is\\ need to ensure theables. compile point.\\ "", ""('', '//ensureables\\ theised\\n')"", ""('', '// we-observable getsifiers\\ ids id\\n')"", ""('', '// weants of observableables gets ids ids\\n')"", ""('', '// descend assigned id id\\ so it\\n')"", ""('', '// already observable ofn ids id\\n')"", ""('', '// only we fields30level observ fields- earn')"", ""('', '// now-view fields\\\\ ids id\\ we\\\\ be\\ated\\n')"", ""//""', '// non need't need ids to non expressions expressions\\ they weation them() to own idn"")', ""('', '// now to\\n')"", ""('', '// now sure that expressions sierpObable public void testInvalidIn()Observable() {\\ //ito mockinder b = new MockLayoutBinder(); lb... new.bindModel(); m.setModel(x"", "".class);getNameCanonicalName()); ""); lb m< mCallExpr new(""new, ""user.getMethodMethod()""); nullCallExpr.class); assertEquals(methodCall.getStaticBinding assertExprModel.inal(); assert ListprModel = methodCall.getChild(); assertTrue(child instanceof MethodaticMethodExpr); assertaticIdentifierExpr static = (StaticIdentifierExpr) child; assertEquals(User.getIdvedType(),getCanonicalName(), "".class.getCanonicalName()); }"","
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Sets the value for the marker and sends a {@link MarkerChangeEvent} to\\\\n * all registered listeners.\\\\n *\\\\n * @param value the value.\\\\n *\\\\n * @see #getValue()\\\\n *\\\\n * @since 1.0.3\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void test1802195() throws IOException, ClassNotFoundException { ValueMarker m1 = new ValueMarker(25.0); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(m1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); ValueMarker m2 = (ValueMarker) in.readObject(); in.close(); assertEquals(m1, m2); m2.setValue(-10.0); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: anor
:
of a that the,
a
to....
TheThe#
:
##\\
\\\\\ =
..
of the value. the the
i}er} the.
thenn\\ * S\\\\ers.
nn\\ *\\nn\\ *\\\\et\\1 value of
nn\\ *\\nn\\ *\\\\\\\\\\@nn\\ *\\nn\\ *\\\\\\19
.\\.nn\\ *\\ *\\
#####\\.
the
## sierp@J *\\\\
...00.@@ a11,,,n *J,,, m \111,,1,
1.,,, Byte ByteArray{{
Byte[]String; Object Object[]{new)
Object,
.;buffer),
Object.n( out[]. the new Object[](new Object ObjectArray)(new)new.Array)
*J in10 newnew)2 in new
s;
Object.
; Object false(new),m1)
m2)2; m1))2, m
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Unregisters the MBean with the specified sub-type and name.\\\\n *\\\\n * @param subType\\\\n * The sub type for the MBean.\\\\n * @param name\\\\n * The name of the MBean.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testUnregisterOnJMException() throws JMException { final MBeanServer mockServer = createMock(MBeanServer.class); final Capture<ObjectName> captureName = new Capture<ObjectName>(); final Capture<ObjectName> captureName2 = new Capture<ObjectName>(); expect(mockServer.isRegistered(capture(captureName))).andReturn(true); mockServer.unregisterMBean(capture(captureName2)); expectLastCall().andThrow(new InstanceNotFoundException()); replay(mockServer); final JmxSupport support = new JmxSupport(mockServer); support.unregister(""subType"", ""foo""); verify(mockServer); final ObjectName name = captureName.getValue(); assertThat(name, notNullValue()); assertThat(name.getDomain(), is(JmxSupport.DOMAIN_NAME)); assertThat(name.getKeyProperty(""type""), is(""metrics"")); assertThat(name.getKeyProperty(""subType""), is(""subType"")); assertThat(name.getKeyProperty(""name""), is","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisiques a givenessen from the given nametypename. name.\\\\n * @\\n * @param subType the\\n * The sub- of the MBean.\\\\n * @param name\\\\n * The name of the MBean.\\\\n *\\ ']
### Solution:Unit: the:
sierpTest public public void testUnregisterMSubMX() throws ExceptionMException { M MBeanServer mServer = mockMock(MBeanServer.class); final Objecture<ObjectName> capture = = new Capture<ObjectName>(); final Capture<ObjectName> captureSub2 = new Capture<ObjectName>(); final(mockServer.getRegistered(captureNamecaptureName),).andReturn(false); expectServer.unregisterMBean(captureNamecaptureName2)); reLastCall().andThrow(new JanceNotFoundException("" replay(mockServer); try MMM j = new JmxSupport(mockServer); support.unregisterOncomType"", ""name""); verify(mockServer); assert MName name = newName.getValue(); assertEquals(name, is(Value()); assertThat(name.getKey(), is(""nullMSupport.DEFAULTMAIN));NAME)); assertThat(name.getKey(),(),sub""), is(""subrics"")); assertThat(name.getKeyProperty(""subType""), is(""subType"")); assertThat(name.getKeyProperty(""name""), is("""
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(\'/**\\\\n\\\\t * Creates an XML string representing this rule.\\\\n\\\\t *\\\\n\\\\t * @param indent\\\\n\\\\t * \\\\t\\\\tthe string used to indent inner XML, possible {@code ""\\\\\\\\t""}\\\\n\\\\t *\\\\n\\\\t * @return this rule as an XML string\\\\n\\\\t */\', \'\')']
### Test JUnit in Java:
","@Test public void toXmlLines_validRule_containsAllInformation() throws Exception { XmlRule rule = new XmlRule(""DEPENDENT"", ""DEPENDENCY"", Severity.FAIL); List<String> lines = rule.toXmlLines("""").collect(toList()); assertThat(lines).containsExactly( ""<xmlRule>"", ""<dependent>DEPENDENT</dependent>"", ""<dependency>DEPENDENCY</dependency>"", ""<severity>FAIL</severity>"", ""</xmlRule>""); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Inst ##ow. a anor
the
of a that the,
a
.....
TheThe# #: The##t'J
\\\'n\\
ated a instruction.. an..
nn\\tn\\\\nn\\\\\\\\\\Creet.t\\\\\\\\\\\\\\nn\\\\nest\\\\ where be\\ join\\ XML,t}\\\\\\nn\\\\ntt\\\\\\\\\\\\\\\\\\\\\\\\param\\.. a XML,,\\\\\\\\\\\\\\n \\\n/
\#\.Unit
the. \## sierp@J@ \ String
1__1__
.
@@ }} rule X }new"")"")"")ITY ""DEPEND"")"")"")"") ""ity)
ILS
sE> _ {,
. _DE
()
,<
ed theto)
(actly.lines "">> "" <xml> PEND""ERdependent> "" <"">DEPEND</DF</ dependent> <dependent>>>DECTSsever>> <se>>DE "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Returns a topological order iterator.\\\\n * \\\\n * @return a topological order iterator\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testTopoIterationOrderComplexGraph() { for (int seed = 0; seed < 20; seed++) { DirectedAcyclicGraph<Long, DefaultEdge> dag = new DirectedAcyclicGraph<>(DefaultEdge.class); RepeatableRandomGraphGenerator<Long, DefaultEdge> graphGen = new RepeatableRandomGraphGenerator<>(100, 500, seed); graphGen.generateGraph(dag, new LongVertexFactory(), null); ConnectivityInspector<Long, DefaultEdge> connectivityInspector = new ConnectivityInspector<>(dag); Iterator<Long> internalTopoIter = dag.iterator(); List<Long> previousVertices = new ArrayList<>(); while (internalTopoIter.hasNext()) { Long vertex = internalTopoIter.next(); for (Long previousVertex : previousVertices) { connectivityInspector.pathExists(vertex, previousVertex); } previousVertices.add(vertex); } } }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public This the string sort of over\\\\n * @\\nn * @return an topological order iterator.\\n */"" ']
### Solution:Unit: the:
sierpTest public public void testTopologicalOrder()()()x()() { { Top (int i = 0; seed < 10; seed++) GraphedGraphcyclicGraph<Integer, LongEdge< graph = new new DirectedAcyclicGraph<LongnewEdge.class); dagversableDirect r<<Long, DefaultEdge> rGenerator = new RepeatableRandomGraphGenerator<>(dag00, 10,, , graphGen.add((dag); Default(Id< new); TopivityTestspector<Long, DefaultEdge> inspectivityInspector = new ConnectivityInspector<>(dag); connectator<Long> itIteratoroIter = .top(); Iter<Long> top =ices = new ArrayList<>(); while (internalTopoIter.hasNext()) { Long vertex = internalTopoIter.next(); if (Long neighborVertex : previousVertices) { ifivityInspector.check((vertex, previousVertex); }previous previousVertices.add(vertex); } } }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(""/**\\\\n * Build the standard global auth constraint from standard RestConfig.\\\\n *\\\\n * <p>The valid roles is extracted from {@link RestConfig#AUTHENTICATION_ROLES_CONFIG}\\\\n *\\\\n * <p>OPTIONS requests will not require auth if\\\\n * {@link RestConfig#ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG} is not empty.\\\\n *\\\\n * @param restConfig the rest app\'s config.\\\\n * @return the constraint mapping.\\\\n */"", \'\')']
### Test JUnit in Java:
","@Test public void shouldCreateGlobalConstraintWithNoMethodsOmittedForNonCor() { // Given: config = restConfigWith(ImmutableMap.of( RestConfig.ACCESS_CONTROL_ALLOW_ORIGIN_CONFIG, """")); // When: final ConstraintMapping mapping = AuthUtil.createGlobalAuthConstraint(config); // Then: assertThat(mapping.getMethodOmissions(), is(nullValue())); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp ru of Aow. the in in is the lot of a. a.
a second Java....
TheThe# \:1
A_*n""""] *
the
error ... the tooreure
nn
*
nn * BuildAn>
ity of the from thep Therict;}H}ITY}1LE}RO}nnn
*\\\n *\\p>
ION.. be be a. thenn\\ *\\link RestConfig}AUTH_ROROLE}ROLOCERROIGINSAUT}
a a if
nn\\ *\\nn *\\A[ @
rest of.s.s
nn\\ *\\param \ rest. from
nn *\\ ""nn
#\.UnitTest the.
## sierp@
1 static
Throw(()()(Args()itted()(Nullout
public
a
//
Config;NoconfigmutableMap<Builder(Im ""Config.ofCESS_CONROL_ORLOW_ORIGIN_CONFIG)); config
} Given: public voidstraintWith< = configConfig.getGlobalConstraintConfigWithconfig); // }: final mapping(config);get((itted()); ""MethodObject));)); public
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Registers an input format with this builder.\\\\n * @param inputformat The input format to register with this builder.\\\\n * @return This builder.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testWithInputformatCalledTwiceThrows() { final String inputformat1 = ""inputformat1""; final String inputformat2 = ""inputformat2""; final PipesBuilder builder = new PipesBuilder(); builder.withInputformat(inputformat1); expectedException.expect(IllegalStateException.class); builder.withInputformat(inputformat2); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow::
or
:
of a that the,
a
to....
TheThe#
:
##\\//\\\\ \\
ed\\
an. the..
nn\\ *\\\\et\\.
\\. thes the..
nn\\ *\\\\\\ is.
nn\\ *
\\\\
\\\\#\\ing
the\\
\\ sierp\\J *
this...,enty@ese@@\\ @}@}}. nullJ""1.
final test@format1) ""input""1""
final testrep =,, ""Jes'; final;
draws.input,,,
final =s
sinputlegal,,,
,
final.
draws.input,,, *@\\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Checks that a given concept reference term object is valid.\\\\n\\\\t *\\\\n\\\\t * @see org.springframework.validation.Validator#validate(java.lang.Object,\\\\n\\\\t * org.springframework.validation.Errors)\\\\n\\\\t * @should fail if the concept reference term object is null\\\\n\\\\t * @should fail if the name is a white space character\\\\n\\\\t * @should fail if the code is null\\\\n\\\\t * @should fail if the code is an empty string\\\\n\\\\t * @should fail if the code is a white space character\\\\n\\\\t * @should fail if the concept reference term code is a duplicate in its concept source\\\\n\\\\t * @should fail if the concept source is null\\\\n\\\\t * @should pass if all the required fields are set and valid\\\\n\\\\t * @","@Test @Ignore @Verifies(value = ""should fail if the name is an empty string"", method = ""validate(Object,Errors)"") public void validate_shouldFailIfTheNameIsAnEmptyString() throws Exception { ConceptReferenceTerm term = new ConceptReferenceTerm(); term.setName(""""); term.setCode(""code""); term.setConceptSource(Context.getConceptService().getConceptSource(1)); Errors errors = new BindException(term, ""term""); new ConceptReferenceTermValidator().validate(term, errors); Assert.assertEquals(true, errors.hasFieldErrors(""name"")); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thiss if the method string is is is is not.\\\\n\\\\t * @\\n\\\\t * @param Con.open.context.Validator\\validate(Object.lang.Object, org\\n\\\\t * java java.springframework.validation.Validator)\\n\\\\t * @seeValid if the given reference term is is not\\\\n\\\\t * @should fail if the concept is null null space\\\\\\n\\\\t * @should fail if the name is a\\\\n\\\\t * @should fail if the code is a empty string\\\\n\\\\t * @should fail if the code is a white space character\\\\n\\\\t * @should fail if the code reference term object is not white of the concept reference\\\\n\\\\t * @should fail if the concept reference is null\\\\n\\\\t * @should fail if the the other fields are present\\ valid\\\\n\\\\t * @should sierpparam\\publicSupp publicSuppifies value = ""should fail if the concept is a empty string"", method = ""validate"")Con, Valid)"") public void should_nameFailIfTheNameIsAnEmptyString( throws Exception { ConceptReferenceTerm concept = new ConceptReferenceTerm(); term.setName(""""); Errors.setCode("""");""); term.setConceptSource(new.getConceptSource().getConceptSource(""1)); Errors errors = new DefaultException(term, """");""); assert ConceptReferenceTermValidator().validate(term, errors); assert.assertTrue(1, errors.hasErrorsErrors(""name"")); "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t *\\\\n\\\\t * @return a String representation of the DoubleRange\\\\n\\\\t * @should print the range if high and low are not null and not infinite\\\\n\\\\t * @should print empty high if high is infinite\\\\n\\\\t * @should print empty low if low is infinite\\\\n\\\\t * @should print empty string if low and high are infinite\\\\n\\\\t */', '')"", ""('', '//BUG: should not append this if high is also infinite\\n')""]
### Test JUnit in Java:
","@Test public void toString_shouldPrintEmptyLowIfLowIsNull() throws Exception { DoubleRange r = new DoubleRange(null, 1.0); assertEquals(""< 1.0"", r.toString()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
:
of a that the,
a
to....
TheThe# is:
##\\
\\\\\nn\\\\\\n\\\\\\\\\\\\. method. of the
..tn\\tn\\\\returner.\\ of the. low and the high. not null andnn\\tn\\\\should\\ the\\ and high and not\\nn\\tn\\\\should print the high\\ high high not\\nn\\tn\\@should print the high\\ high high not and not\\nn\\tn\\@ '
'\\\\ ""\\',', ' print print the is high and not not\\n\\@
###'.
## the\\ should## sierpshouldJ should \\ the n
ifow shouldNullow,In,
as
shouldL{ = Double Double }{new,null201)
Double false(""1.1. )1)
r
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Deletes all department head assignments of the given person.\\\\n *\\\\n * @param event the person who is deleted\\\\n */', '')""]
### Test JUnit in Java:
","@Test void ensureDeletionOfDepartmentHeadAssignmentOnPersonDeletionEvent() { final Person departmentHead = new Person(); departmentHead.setId(42L); final Person other = new Person(); other.setId(21L); final DepartmentEntity department = new DepartmentEntity(); department.setId(1L); department.setDepartmentHeads(List.of(departmentHead, other)); when(departmentRepository.findByDepartmentHeads(departmentHead)).thenReturn(List.of(department)); when(departmentRepository.findById(1L)).thenReturn(Optional.of(department)); when(departmentRepository.save(department)).thenReturn(department); sut.deleteDepartmentHead(new PersonDeletedEvent(departmentHead)); verify(departmentRepository).findByDepartmentHeads(departmentHead); ArgumentCaptor<DepartmentEntity> argument = ArgumentCaptor.forClass(DepartmentEntity.class); verify(departmentRepository).save(argument.capture()); assertThat(argument.","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisletes a the recordsingsments for a given department.\\\\n * @\\n * @param person the event to is to\\\\n *""] '""]
### Inst:Unit: the:
sierpTest public public testDeleteletionOfPersonartmentHeadAssignment()PersonDeletion()() { Person Person personHead = new Person("" departmentHead.setId(1L);); department Person personPerson new Person(); other.setId(4LL); final PersonHead department = new DepartmentEntity(); department.setId(1L); department.setNameartmentHead((newsof(departmentHead)); other)); department(departmentHead.findByIdDepartmentId((anypartmentHead)).thenReturn(de.of(department)); when(departmentHead.findBy(anyL)).thenReturn(Optional.of(department)); when(departmentRepository.delete(department)).thenReturn(department); whenut.deleteDepartmentHeadAssnew PersonDeletEvent(departmentHead)); assert(departmentRepository,deleteByDepartmentHeads(departmentHead); verifyCaptor<DepartmentEntity> captCapt ArgumentCaptor.forClass(DepartmentEntity.class); verify(departmentRepository,save(argument.capture()); assertThat(argument.getValue"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * {@inheritDoc}\\\\n * <p>\\\\n * Returns the result of the {@link UUID#toString()}.\\\\n * </p>\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testValueAsString() { final UuidElement element = new UuidElement(""f"", TEST_UUID); assertEquals(TEST_UUID.toString(), element.getValueAsString()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\\
\\\\\ =
iherit}}nnn{ *\\\\>
nn\\ *\\ the
of the
in}sed}\{\{\
nn\\ *\\p>\\nn\\ *
\\#\\.Unit
the
## sierp@J *
public,
public}}}}} U Uuid;}U"") ""STestUU)
* false,TE)UU)
) TE)
)))
U
\"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Writes a human readable form of the collection metrics.\\\\n *\\\\n * @param writer\\\\n * The writer to write to.\\\\n */', '')"", ""('', '// Use the identity hash code as a stable identifier.\\n')""]
### Test JUnit in Java:
","@Test public void testWriteToPrintWriter() { final StringWriter sink = new StringWriter(); final PrintWriter writer = new PrintWriter(sink); final BasicConnectionMetrics metrics = new BasicConnectionMetrics(null); metrics.writeTo(writer); assertThat( sink.toString(), is(""Connection["" + System.identityHashCode(metrics) + "": sentBytes=0, sentCount=0, receivedBytes=0, receivedCount=0, "" + ""lastLatency=0 ms, totalLatency=0 ms]"")); // For Closeable. metrics.close(); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thises a string- string of the given to to\\\\n * @\\n * @param metrics The\\n * The writer to write the.\\\\n *""] '] ""public/** '\\', the given function code for the hash hash for',\\',"",
### Inst:Unit: the:
sierpTest public public void testGetTo()Writer() throws Print Print[] writer = new StringWriter(); final PrintWriter writer = new PrintWriter(sink); sink CollectionMetMetrics metrics = new BasicConnectionMetrics();1, metrics.writeTo(writer); assertEquals(s sink.toString(), contains(\\ metrics + + "".identityHashCode(metrics) + "" ""=""=""0, receivedMessages=0, receivedBytes=0, receivedCount=0, "" + ""receErroratency=0,, lastLatency=0 ms,"")); }@ theable,close sink.close(); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Constructors\\\\n\\\\t */', '')"", ""('', '// default the Filter\\tto match all Flags that contain one or more of the tags in the filter\\n')""]
### Test JUnit in Java:
",@Test public void filter_shouldFilterListOfFlags() { List<Flag> flags = Context.getService(FlagService.class).getAllFlags(); Tag tag = Context.getService(FlagService.class).getTag(1); Set<Tag> tags = new HashSet<>(); tags.add(tag); Filter filter = new Filter(tags); List<Flag> filterFlags = filter.filter(flags); assertTrue(flags.size() != filterFlags.size()); },"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Inst ##ow. a anor
the
of a that the,
a
.....
TheThe# #: The##\\
n\\\\nn\\
jing.nn\\\\\\\\
""\\\\ ""\\'');
.n\\ the\\at. the the of two. the
. the first.\\\\
#####'s
the
## sierp@J J static
test_
_fer
public<List>}} List(
()}1))get)
Service)()
List}; Tag.getAll;Flag))class)getAll{Flag0
List<Flag>
; Context SetSet<
List;getitionalTag)
Tags.; Filter Filter;Filter) Filter<Flag>
_; new;get.filter)
Listed)flag)get)
true))filter(
Filter
{"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Verilen de\\\\xc3\\\\x84\\\\xc5\\\\xb8eri ayn\\\\xc3\\\\x84\\\\xc2\\\\xb1 birim olmak \\\\xc3\\\\x83\\\\xc2\\\\xbczere \\\\xc3\\\\x83\\\\xc2\\\\xa7arpar\\\\n * \\\\n * @param base\\\\n * @param amount\\\\n * @return \\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testmultiply1() throws UnitException { System.out.println(""multiply1""); QuantitativeAmount q = new QuantitativeAmount(BigDecimal.TEN, MassUnitSet.GRAM); QuantitativeAmount expResult = new QuantitativeAmount( new BigDecimal(100), MassUnitSet.GRAM); QuantitativeAmount result = Quantities.multiply(q, BigDecimal.TEN); assertEquals(expResult, result); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisifies birğ\\n3\\xaxb3er\\xc3\\\\x91\\\\\\\\\\xc3\\\\x84\\\\xc5\\\\x94\\ dedemasak z\\\xc3\\\\xb4\\\\xc2\\\\xb7\\ g\\\xc3\\\\x84\\\\xc2\\\\x0\\\m\\xc\\ * \\\\xc * @param de The\\n * @return target\\\\n * @return\\\\\n *\ '""]
### SolutionsUnit: Action:
sierpTest public public void testAddly()() { ExceptionTest { double.out.println(""multiply1""); assertityTest amounta new QuantitativeAmount(1Decimal.valueOfEN, ""Unit..GRAM); QuantitativeAmount qResult = new QuantitativeAmount(Big BigDecimal(10),), MassUnitSet.GRAM); QuantitativeAmount result = qitative.multiply(q, qDecimal.ONEEN); assertEquals(expResult, result); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '//\\n')"", ""('', '//\\n')""]
### Test JUnit in Java:
","@Test public void deletedEntriesAreNotMigrated() { fromKvs.createTables(TEST_AND_CHECKPOINT_TABLES); fromTxManager.runTaskWithRetry(tx -> { tx.put(TEST_TABLE, ImmutableMap.of(TEST_CELL, TEST_VALUE1)); return tx.getTimestamp(); }); fromTxManager.runTaskWithRetry(tx -> { tx.delete(TEST_TABLE, ImmutableSet.of(TEST_CELL)); return tx.getTimestamp(); }); KeyValueServiceMigrator migrator = KeyValueServiceMigrators.setupMigrator(migratorSpec); migrator.setup(); migrator.migrate(); assertThat(toKvs.get(TEST_TABLE, ImmutableMap.of(TEST_CELL, Long.MAX_VALUE))) .isEmpty(); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test] ')'',',',""] ""//', '//\\n')"",
### Inst CaseUnit: the:
sierpTest public public void test_ries()NotInovedated() throws assert(afka.put(""();true_TABLEROREECK_OINT_TABLES); fromKxn.start((outry(newManager { tx.delete(""TEST_AND_ ""mutableMap.of(""TEST_KEYLL, ""ST_VALUE));)); tx null.commit((); }); fromKxManager.runTaskWithRetry(tx -> { tx.put(TEST_TABLE, TEmutableMap.of(TEST_CELL)); return tx.getTimestamp(); }); fromValueService fromigrator migrator = newValueServiceMigrrators.create(igrator(fromateConfig -> migrator.migr( migrator.migrate(); assertEquals(fromKvs.get(TEST_TABLE, TEmutableSet.of(TEST_CELL, TE.class_VALUE))
.contains(); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Discover if the given ViewId is mapped by any {@link UrlMapping} specified in the current configuration.\\\\n * <p>\\\\n * <b>Note:</b>This will not match if a #{dynamicView.id} method is configured.\\\\n * \\\\n * @return True if the ViewId is mapped, false if not.\\\\n */', '')""]
### Test JUnit in Java:
",@Test public void isNullViewMappedReturnsFalse() throws Exception { assertFalse(config.isViewMapped(null)); },"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\\
\\\\ =\\uss the you
.s. an by the otheri
sed} the
. the
..
nn\\ *
\\>
nn\\ *\\\\>\\ that
n>\\ is be be the the./}}
}<. a by
nn\\ *\\\\nn\\ *\\A the. a given. is a by is, the false
nn\\ *\ *
\\#\.Unit
the.
## sierp@J * if a
ed ifs.;
. public
public false}f)
.)ed)config,
\ \"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Generates a random bipartite graph.\\\\n * \\\\n * @param target the target graph\\\\n * @param vertexFactory the vertex factory\\\\n * @param resultMap not used by this generator, can be null\\\\n */', '')"", ""('', '// create vertices\\n')"", ""('', '// check if graph is directed\\n')"", ""('', '// create edges\\n')"", ""('', '// s->t\\n')"", ""('', '// t->s\\n')""]
### Test JUnit in Java:
","@Test public void testDirectedGraphGnp1() { GraphGenerator<Integer, DefaultEdge, Integer> gen = new GnpRandomBipartiteGraphGenerator<>(4, 4, 0.5, SEED); Graph<Integer, DefaultEdge> g = new DirectedPseudograph<>(DefaultEdge.class); gen.generateGraph(g, new IntegerVertexFactory(1), null); int[][] edges = { { 5, 1 }, { 1, 6 }, { 6, 1 }, { 1, 7 }, { 1, 8 }, { 2, 5 }, { 6, 2 }, { 7, 2 }, { 2, 8 }, { 5, 3 }, { 3, 6 }, { 7, 3 }, { 3, 8 }, { 4, 5 }, { 5, 4 }, { 4, 6 }, { 6, 4 }, { 4, 7 }, { 4, 8 }, { 8, 4 } }; assertEquals(4 + 4, g.","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisates a random numberounite graph with\\\\n * @\\nn * @param nSize number size\\\\n * @param numCount the vertex factory\\\\n * @param edge the the used\\ this method\\ but be null\\\\n *""] '] ""public/** 'public Gener a\\\\ "", ""('', '// create if the is b\\n')"", ""('', '// check edges\\n')"", ""('', '// checkiftv\\n')"", ""('', '// check->s\\n')"",
### Inst:Unit: the:
sierpTest public public void testRandomed()()()()() { { GraphGenerator gInteger, IntegerVertex< Default> g = new new Directnp1GraphipartiteGeneratorGenerator<>(1, 4, 0.5); ED); Graph<Integer, DefaultEdge, graph = gen DefaultedGraphseudoograph<>(genEdge.class); gen.generate((g, SE HashMapVertexFactory<40 new); assert[][] adj = g 0, 0, { 1, 2 }, { 2, 2 }, { 1, 2 }, { 7, 2 }, { 1, 1 }, { 2, 2 }, { { 2, 2 }, { 8, 3 }, { 3, 7 }, { 3, 5 }, { 3, 3 }, { 3, 8 }, { 5, 5 }, { 4, 4 }, { { 4, 6 }, { 6, 4 }, { 4, 7 }, { 6, 8 }, { 5, 4 }, }; forEquals(ed, 4, g.get"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// If the vertex is free-flowing then (by definition) there is no duration to traverse it.\\n')""]
### Test JUnit in Java:
","@Test public void testWalkTrafficLights() { // Graph with an intersection with traffic lights IntersectionVertex v1 = vertex(""maple_1st"", new Coordinate(2.0, 2.0), false, false); IntersectionVertex v2 = vertex(""maple_2nd"", new Coordinate(2.0, 1.0), false, true); StreetEdge e1 = edge(v1, v2, 1.0, false); IntersectionVertex v3 = vertex(""test2"", new Coordinate(1.0, 1.0), false, false); StreetEdge e2 = edge(v2, v3, 1.0, false); // With traffic lights on both directions assertEquals( 15.1125, calculator.computeTraversalDuration(v2, e1, e2, TraverseMode.WALK, 40, 40), 0.1 ); assertEquals( 15.1125, calculator.computeTraversalDuration(v2, e2, e1, TraverseMode","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\\ 'J'.
. a.verer.
free the)
is a.. the..
\\
##### Description.
the.
## sierp@J1 static
riterinerava.
@
QL the
of a., @section
, v1ver"")"",v"","", ""_al)n)
) new2.5) \, false,
falsesectionV)1, false2verle"",1"","", ""Vordinate)2)0, false2,0, false, false, false, vy. false11,, v1, v2,0, false, falsesection v v2. false4ver"","") "" Verordinate)2.0, false2.0, false, false, Inter v e1 = edge2v,, 2, false1.0, false, Inter falsedraw;. the sides; //ed(v2,,1,,,, 1ates,
,verseal,.1,,v,, e1, eversee,
,e, false1., 4,, false4,0, false
Intered(515.1,,,, 1ator.
Traverseal,(v2, e2, e2, everseMode.Tra"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Add a mapping feedback callback class. If one already exists a runtime\\\\n * exception is thrown.\\\\n * @param mf the mapping feedback callback listener.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void classpath_mapping_feedback_null() { RuntimeException e = assertThrows(RuntimeException.class, () -> BshClassPath.addMappingFeedback(null)); assertThat(e.getMessage(), containsString(""Unimplemented: already a listener"")); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow::
or
:
of a that the:
a
to....
TheThe#
:
##\\//\\\\ \\
itional method the...
you... method.nn\\ *\\\\ a.
nn\\ *\\\\\\.\\\\ the...
nn\\ *
\\\\
\\\\#\\.
the\\
\\ sierp@J *\\\\,,n_mback_f_@\\ @ se null(ese.aes
,n@ null J.adows.s
itional.back.R,
*@ thenull,n,
.,Jitspros"","",,,,
*
n"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(\'/**\\\\n * Gets a builder configured with default Kiji URI fields.\\\\n *\\\\n * More precisely, the following defaults are initialized:\\\\n * <ul>\\\\n * <li>The Zookeeper quorum and client port is taken from the Hadoop <tt>Configuration</tt></li>\\\\n * <li>The Kiji instance name is set to <tt>KConstants.DEFAULT_INSTANCE_NAME</tt>\\\\n * (<tt>""default""</tt>).</li>\\\\n * <li>The table name and column names are explicitly left unset.</li>\\\\n * </ul>\\\\n *\\\\n * @return A builder configured with this Kiji URI.\\\\n */\', \'\')']
### Test JUnit in Java:
","@Test public void testConstructedUriIsEscaped() { // SCHEMA-6. Column qualifier must be URL-encoded in CassandraKijiURI. final CassandraKijiURI uri = CassandraKijiURI.newBuilder(""kiji-cassandra://zkhost/chost:5678/instance/table/"") .addColumnName(new KijiColumnName(""map:one two"")).build(); assertEquals( ""kiji-cassandra://zkhost:2181/chost:5678/instance/table/map:one%20two/"", uri.toString()); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Testn +\\\\\\\ * ets the random for with the valuesafka settings..\\\\n * @\\n * @ info, this builder fields are used:\\\\n *\\ul>\\\\n * < <li>\\ Kookeeper URIorum is session port are set from the Kadoop configurationcode>zo</tt>li>\\\\n * <li>The Kiji URI name is taken to thett>kiji.DEFAULT_INSTANCE_NAME</tt></\\\\n * (whichtt>k""</tt>).\\li>\\\\n * <li>The K name is namespace name are set set emptyset.</li>\\\\n * ul>\\\\n * <\\n * @return a < configured with default defaultiji URI.\\\\n *\'] ''']
### Solution:Unit: K:
sierpTest public public void testGetstructURIK()Validvenaped() { K GUTEMA_101 namesifier is be escaped-encoded. theandra.ijiURI. assert KandraKijiURI uri = Cass CassandraKijiURI.builderBuilder().kiji://instanceassandra://localhost::defaultang:9978/default/default/column .buildColumnQual(""COL ColumnijiColumnName(""foo"",key"", three).build(); assertEquals(""C ""kiji-cassandra://zkhost/5181/chost:5678/instance/table/map:one%20two"","", .toString()); }"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// Rejects non HS512 token\\n')""]
### Test JUnit in Java:
","@Test(expected = IllegalArgumentException.class) public void test_resolve_signing_key_throws_error_on_invalid_key_id() { JwsHeader jwsHeader = new DefaultJwsHeader(); jwsHeader.setAlgorithm(""HS512""); jwsHeader.setKeyId(""key id 666""); Claims claims = new DefaultClaims(); cerberusSigningKeyResolver.resolveSigningKey(jwsHeader, claims); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer ##ow:: anor
:
of a that the,
a
to....
TheThe#
:
##\\ '
'asons
-.
...:'\\
#####
.
the.
## sierpJ
J) nulllegal in)s
,J1Test inJtest_testature intest_testese_key_th_test_th_n_@
Test...,,. nullJ.,,.
Jw,,
terorithm,J"","","","",
Jw,.jter,,J_"",1..6
juse. ClaJJlaims, J,;,ature.,.s,ature.,J,,,j)
1 J"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
['(""/**\\\\n * Parse a comma-separated list of authentication mechanisms. Each\\\\n * such mechanism should be of the form \'scheme:auth\' -- the same\\\\n * syntax used for the \'addAuth\' command in the ZK CLI.\\\\n * \\\\n * @param authString the comma-separated auth mechanisms\\\\n * @return a list of parsed authentications\\\\n * @throws {@link BadAuthFormatException} if the auth format is invalid\\\\n */"", \'\')']
### Test JUnit in Java:
","@Test public void testGoodAuths() { List<ZKAuthInfo> result = ZKUtil.parseAuth( ""scheme:data,\n scheme2:user:pass""); assertEquals(2, result.size()); ZKAuthInfo auth0 = result.get(0); assertEquals(""scheme"", auth0.getScheme()); assertEquals(""data"", new String(auth0.getAuth())); ZKAuthInfo auth1 = result.get(1); assertEquals(""scheme2"", auth1.getScheme()); assertEquals(""user:pass"", new String(auth1.getAuth())); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Testa""*\\\\ * This a string-separated list of values tokensisms.\\ mechanism\\n * mechanism mechanism is be a the form ""\\meeme\\me\' where where scheme as\\n * format as by the authentication'auth\'\' method. the APIoo API.\\\\n * \nnn * @param auths The string-separated list stringisms\\\\n * @return a list of authentication authenticationations\\\\n * @throws Zlink InvalidArgumentExceptionException} if the authString is\\\\\\n *\ ""\\n]
### Solution:Unit: the:
sierpTest public public void testParseAuth()() throws String<AuthenticationKAuth>> auth = ZKAuth.parseAuthsZ ""\""eme:auth"");""sch scheme::data,pass""); assertEquals(2, result.size()); assertKAuthInfo auth1 = result.get(0); assertEquals(""scheme"", auth0.getScheme()); assertEquals(""data"", auth String(auth0.getData())); ZKAuthInfo auth1 = result.get(1); assertEquals(""scheme2"", auth1.getScheme()); assertEquals(""user:pass"", new String(auth1.getAuth())); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * @see org.openmrs.module.webservices.rest.web.api.RestService#getResourceByName(String)\\\\n\\\\t * <strong>Should</strong> return resource for given name\\\\n\\\\t * <strong>Should</strong> return resource for given name and ignore unannotated resources\\\\n\\\\t * <strong>Should</strong> fail if failed to get resource classes\\\\n\\\\t * <strong>Should</strong> fail if resource for given name cannot be found\\\\n\\\\t * <strong>Should</strong> fail if resource for given name does not support the current openmrs version\\\\n\\\\t * <strong>Should</strong> return subresource for given name\\\\n\\\\t * <strong>Should</strong> fail if subresource for given name does not support the current openmrs version\\\\n\\\\t * <strong>Should</strong> fail if","@Test public void getResourceByName_shouldFailIfTwoResourcesWithSameNameAndOrderAreFoundForGivenName() throws Exception { List<Class<? extends Resource>> resources = new ArrayList<Class<? extends Resource>>(); resources.add(AnimalResource_1_9.class); resources.add(DuplicateNameAndOrderAnimalResource_1_9.class); when(openmrsClassScanner.getClasses(Resource.class, true)).thenReturn(resources); setCurrentOpenmrsVersion(""1.9.10""); expectedException.expect(IllegalStateException.class); expectedException.expectMessage(""Two resources with the same name (v1/animal) must not have the same order""); restService.getResourceByName(""v1/animal""); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ Thisparam\\.apacheqars.module.rad..api.Open.controller.vful#getPat(U(String,\\n\\\\t * @p>\\ returnstrong> return a with given name\\\\n\\\\t * @p>Ex</strong> return null for given name\\ version theavailableated fields\\\\n\\\\t * <strong>Should</strong> return if resource to find resource by\\\\n\\\\t * <strong>Should</strong> fail if failed class given name does be found\\\\n\\\\t * <strong>Should</strong> fail if resource for given name cannot not exist given given versionmrs version\\\\n\\\\t * <strong>Should</strong> fail resource- for given name\\\\n\\\\t * <strong>Should</strong> return if subresource for given name cannot not exist the current openmrs version\\\\n\\\\t * <strong>Should</strong> fail if sub sierpseeResource void getResourceByName_should_IfResourceResourcesHaveSameNameExDingAn()SivenVersion( throws Exception { Rest <Resource<? extends Resource>> resources = new ArrayList<Class<? extends Resource>>(); .add(Resourcenot..1.1_class); resources.add(AnoglicateResourceResourceOrderResourceimalResource_1_9.class); (resourcemrsResourceServiceanner.getResource(An.class)). "")).thenReturn(resources); UpOpenMrsVersion(1.9"");0"");""); whenException.expect(IllegalArgumentException.class); Exception.expectMessage(""D resources with the same name andAneter.Animal) and have be the same order""); Service.getResourceByName(""v1/animal""); "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Creates new pair of elements pulling of the necessity to provide corresponding types of the\\\\n * elements supplied.\\\\n *\\\\n * @param a first element\\\\n * @param b second element\\\\n * @param <A> the first element type\\\\n * @param <B> the second element type\\\\n * @return new pair\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testUnorderedPairEquals() { Pair<String, Custom> p1 = UnorderedPair.of(CUSTOM, new Custom(1)); Pair<String, Custom> p2 = UnorderedPair.of(ANOTHER, new Custom(1)); Pair<String, Custom> p3 = UnorderedPair.of(ANOTHER, new Custom(2)); Pair<String, Custom> p4 = UnorderedPair.of(CUSTOM, new Custom(1)); Pair<String, Custom> p5 = UnorderedPair.of(CUSTOM, new Custom(2)); Pair<Custom, String> p6 = UnorderedPair.of(new Custom(1), CUSTOM); assertNotEquals(p1, p2); assertNotEquals(p1, p3); assertEquals(p1, p4); assertNotEquals(p1, p5); assertEquals(p1, p6); assertNotEquals(p2, p3); assertNotEquals(p2, p4); assertNotEquals(p2, p5);","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp ru of Theow. a Americanal
the lot of a, a.
a first.....
TheThe# #: The
\J*nn\\ =//ated a
of (. the the same of be a to; the
\\n\\ * Cre of by
nn\\ * elementsnn\\ * elementsA{.,.n\\\\ * @param a. \\.nn\\ * @param b@>\\ the element\\ ofnn\\ * @param bA>\\ first element\\\\nn\\ * @param the first ofnn\\ * @@
\# *s
the.
## sierp@
@ static
its
public
publicair}E>...>}1} PorderedPair}pIntint))) Custom C)C)
Pair<String, new>p1} UnorderedPair.of(CYHER, new Custom)1))
Pair<String, Custom> p3 = UnorderedPair.of(ANOTHER, new Custom(1));
Pair<String, Custom> p4 = UnorderedPair.of(ANUSTOM, new Custom(3)); Pair<String, Custom> p5 = UnorderedPair.of(CUSTOM, new Custom(2)); Pair<String> Custom> p6 = UnorderedPair.of(C Custom(3)); newUSTOM, P falseNull(C1) p2, PNotEquals(p3, p2); PNot(p4, p2); PNotEquals(p1, p2); PNot(p1, p3); PNotEquals(p1, p4); PEqualsEquals(p1, p4); PEqualsEquals(p1, p5); "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * Create an instance for an ireg operation\\\\n\\\\t *\\\\n\\\\t * @param physicalFileAbsolutePath\\\\n\\\\t * {@code String} with the absolute path to the physical file to be\\\\n\\\\t * registered\\\\n\\\\t * @param irodsFileAbsolutePath\\\\n\\\\t * {@code String} with the absolute path to the iRODS file to be\\\\n\\\\t * registered\\\\n\\\\t * @param resourceGroup\\\\n\\\\t * {@code String}specifies the resource group of the resource. This\\\\n\\\\t * must be input together with the resourceToStoreTo\\\\n\\\\t * @param resourceToStoreTo\\\\n\\\\t * {@code String} specifies the resource to store to. This can also\\\\n\\\\t * be specified in your environment or via","@Test(expected = IllegalArgumentException.class) public final void testInstanceNullPhysPath() throws Exception { DataObjInpForReg.instance(null, ""irods"", """", """", false, false, ChecksumHandling.NONE, false, """"); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\\\n\\ This a instance of the objectTistry.\\n\\\\t * @\\n\\\\t * @param opAddressPathsolutePath\\\\t\\\\t * @ Thelink physical} the the absolute path of the physical file\\ be created\\n\\\\t * processed\\\\n\\\\t * @param logicalregsFileAbsolutePath\\\\n\\\\t * {@code String} with the absolute path to the iRODS file to be\\\\n\\\\t * registered\\\\n\\\\t * @param iType\\\\n\\\\t * {@code String} withifying the resource group\\ the i\\\\\\\\n\\\\t * parameter be the to with the physical nameRegister.\\\\n\\\\t * param resourceToStoreTo\\\\n\\\\t * {@code String} withifies the resource to store the\\ This must be be\\n\\\\t * be a as the i variables in the sierp{Propertygroups =\\legalArgumentException.class) public void void testCreateCreResourceical() throws Exception { StringStoreInsts dataTestistrationBuilder(null, nulltestds:// "" "" "", false, falsesumTypeling.NONE, null, false""); "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Adds a data item to the series.\\\\n *\\\\n * @param x the x-value.\\\\n * @param y the y-value.\\\\n * @param deltaX the vector x.\\\\n * @param deltaY the vector y.\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void testSerialization() throws IOException, ClassNotFoundException { VectorSeries s1 = new VectorSeries(""s1""); s1.add(1.0, 0.5, 1.5, 2.0); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(s1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); VectorSeries s2 = (VectorSeries) in.readObject(); in.close(); assertEquals(s1, s2); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp ru of Theow. a American in is the lot of a, a.
a first.....
TheThe# \: The
\_*nn""] =//itional the comment to
the list of
nn\\ * Addnn\\ * AddAuthor1.1 corresponding
axis x
nn\\ * Addparam x
* x-value.
nn\\ * @param x
* y.-
nn\\ * @param xX
the y x.\\nn\\ *
\# *s
the
## sierp@
* static
izable()
ThNotFoundException
throws v}}} Vector VectorSeries sx1"")
Vector1}s(s,1, 1.1, 0.1, 1.5,
sVector s s} Byte ByteArrayOutputStream()
s[][]; new ObjectOutputStream();Object)
Object.out((buffer1);
out.write(
outOutputStream out Java new ObjectInput(buffer ); ObjectArrayInputStream( ));byteArrayArray());
Object v s1 = newnewSeries. {;add(( Object.close(); Object false(Object1); s2, }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Parses the program arguments and returns the corresponded command object.\\\\n * @param args the program arguments\\\\n * @return the command object, or {@code empty} if there are no commands to execute (e.g. help)\\\\n * @throws ParameterException if arguments are not valid\\\\n */', '')""]
### Test JUnit in Java:
","@Test public void simple() { JCommanderWrapper<Supplier<String>> commander = new JCommanderWrapper<>(""PG"", new Cmd(""R"")); Optional<String> result = commander.parse().map(Supplier::get); assertThat(result, is(Optional.of(""R""))); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Theow. a anal
the
of a that a,
a
.....
TheThe# #: TheThe\\*nn\\ =//agraph.. corresponding.. the the argumentent to..
nn\\ * ParAuthoret. corresponding..nn\\ * @param the program.. the then}}
( is a if. the the\\)
.g.nn\\ * @returnese theizeds there. the equal.nn\\ *
\\# *sUnit
the.
## sierp@
@ static
@Unitander.}@ress>R>}} null StringCommander<<JJ. "" J))PG"")
J<R>
; null,
.
.Jlier<<)
J sub;String,resultaresult)get)R"")) {
public
{"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// Check if the document has a bound grammar.\\n')""]
### Test JUnit in Java:
","@Test public void checkDocumentWithXSIDocTypeBoundGrammar() throws Exception { MockXMLLanguageServer languageServer = new MockXMLLanguageServer(); String xml = ""<foo xmlns:xsi=\""http://www.w3.org/2001/XMLSchema-instance\"" xsi:noNamespaceSchemaLocation=\""tag.xsd\""/>""; String xmlPath = getFileURI(""src/test/resources/tag.xml""); TextDocumentIdentifier xmlIdentifier = languageServer.didOpen(xmlPath, xml); String xsdPath = getFileURI(""src/test/resources/xsd/tag.xsd""); Boolean actual = (Boolean) languageServer.executeCommand(CheckBoundGrammarCommand.COMMAND_ID, xmlIdentifier, xsdPath).get(); assertNotNull(actual); assertEquals(false, actual); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test] ')'', if the method is a titleing.',n',""]
### Inst:Unit: the:
sierpTest publicpublic void testIfHasoutPathLTocumentGHasGrammar() throws Exception { DocumentedDocument xml serverServer = new MockXMLLanguageServer(); language document = ""! xmlns=\""xsi=\""http://www.w3.org/2001/XMLSchema-instance\ xsi:schemaNamespaceSchemaLocation=\""http.xsd\"">""; language expectedWith = ""ClassPath(""tag/test/resources/tag.xml""); languageDocument document textDocument = newServer.getOpenDocumentxmlPath, xml); language expectedsdPath = getFileURI(""src/test/resources/tag/tag.xsd""); TextDocument = languageBoolean) languageServer.didRequest(newDocumentGrammarCommand.COMMAND_ID, xmlIdentifier, xsdPath);getResult assertTrueNull(actual); assertTrue(true, actual); }
"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Check whether a collection of AvroSchema objects contains a given AvroSchema element, resolving\\\\n * UIDs using the given KijiSchemaTable.\\\\n *\\\\n * @param schemaTable KijiSchemaTable with which to resolve schema UIDs.\\\\n * @param schemaCollection collection of AvroSchemas to check for the presence of the given\\\\n * element.\\\\n * @param element AvroSchema for whose presence to check in schemaCollection.\\\\n * @return whether schemaCollection contains element after resolving UIDs using schemaTable.\\\\n * @throws IOException in case of an error reading from the schema table.\\\\n */', '')"", ""('', '// If none match, return false.\\n')""]
### Test JUnit in Java:
","@Test public void testAvroSchemaListContains() throws IOException { final KijiSchemaTable schemaTable = getKiji().getSchemaTable(); final long stringUID = schemaTable.getOrCreateSchemaId(STRING_SCHEMA); final long intUID = schemaTable.getOrCreateSchemaId(INT_SCHEMA); final String stringJSON = STRING_SCHEMA.toString(); final String intJSON = INT_SCHEMA.toString(); final AvroSchema stringUIDAS = AvroSchema.newBuilder().setUid(stringUID).build(); final AvroSchema stringJSONAS = AvroSchema.newBuilder().setJson(stringJSON).build(); final AvroSchema intUIDAS = AvroSchema.newBuilder().setUid(intUID).build(); final AvroSchema intJSONAS = AvroSchema.newBuilder().setJson(intJSON).build(); final List<AvroSchema> stringList = Lists.newArrayList(stringJSONAS, stringUIDAS); final List<AvroSchema> intList = Lists.newArrayList(intJSONAS, intUIDAS); final List<","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thiss the given contains objectsat objects objects is a schema schemaroSchema.. orving the\\n * theRs to the given UryContextRegistry.\\\\n * \\\n * @param schemaCollection TheijiSchemaTable to which to resolve U UIDs.\\\\n * @param schemaCollection Collection of AvroSchemaemas to check.. given of the given schema\\n * Av schema.\\\\n * @param elementToroSchema to which presence to check. theCollection.\\\\n * @return true theCollection contains the. resolving UIDs. schemaTable.\\\\n */ @throws K if case of an error while the the Av collection.\\\\n *\ ']
public/** 'public Check the of, return false.',n',"",
### InstsUnit:::
sierpTest public public void testContainsroSchemaCollectionContains() throws IOException {
Av KijiSchemaTable schemaTable = newSchemaijiSchemagetSchemaTable("" final List schemaId = schemaTable.getSchemaCreateUIDUID(""String_SCHEMA_ final long intUID = schemaTable.getOrCreateSchemaId(INT_SCHEMA); final long schemaSchema = ""ING_SCHEMA.to(); final String intJSON = INT_SCHEMA.toString(); final ListroSchema stringSchema = = AvroSchema.fromBuilder().setSchemaid(stringUID).set(); final AvroSchema intUIDAS = AvroSchema.newBuilder().setU(stringJSON).build(); final AvroSchema intUIDAS = AvroSchema.newBuilder().setUid(intUID).build(); final AvroSchema intJSONAS = AvroSchema.newBuilder().setJson(intJSON).build(); final List<AvroSchema> schemaSch = Arrays.newArrayList(stringUIDAS, stringUIDAS); final List<AvroSchema> intList = Lists.newArrayList(intJSONAS, intUIDAS); final List<Av"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('', '// FIXME maxDistance can be 0, leading to divide-by-zero\\n')""]
### Test JUnit in Java:
","@Test public void testEmptyListOfStringsSimilarity() { double similarity = LevenshteinTokenUtil.getSimilarity( Arrays.<String>asList(), Arrays.<String>asList()); assertThat(similarity).isEqualTo(1.0, DELTA); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agramer Instow::
or
:
of a
the:
a
to...
TheBel#
:
##Instm
'
.X
' a10
to
-0-\\\\
\\###
the
## sierpJ
@
the,ilar@@@
@
, adim,ens the,ities
eilarest@, '{,s>
,<
<,Test>
,<
public(,a,,
.<<n0
,1V,,
1
T"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * This method is an enhancement of {@link #compareVersion(String, String)} and adds support for\\\\n\\\\t * wildcard characters and upperbounds. <br>\\\\n\\\\t * <br>\\\\n\\\\t * This method calls {@link ModuleUtil#checkRequiredVersion(String, String)} internally. <br>\\\\n\\\\t * <br>\\\\n\\\\t * The require version number in the config file can be in the following format:\\\\n\\\\t * <ul>\\\\n\\\\t * <li>1.2.3</li>\\\\n\\\\t * <li>1.2.*</li>\\\\n\\\\t * <li>1.2.2 - 1.2.3</li>\\\\n\\\\t * <li>1.2.* - 1.3.*</li>\\\\n\\\\t * </ul>\\","@Test @Verifies(value = ""should not match when version has wild card plus qualifier and is outside boundary"", method = ""matchRequiredVersions(String version, String versionRange)"") public void matchRequiredVersions_shouldNotMatchWhenVersionHasWildPlusQualifierCardAndIsOutsideBoundary() { String openmrsVersion = ""1.*.4-SNAPSHOT""; String requiredVersion = ""1.4.0 - 1.4.10""; Assert.assertFalse(ModuleUtil.matchRequiredVersions(openmrsVersion, requiredVersion)); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Theow. a anor
the
of a that a,
a
.....
TheThe# #: The##\\
n\\\\nn\\
is is an instructionancement. thethis This\e}1, String,
String a. thenn\\tn\\\\card*\\ wild wild and
\\ />
nn\\tt\\\\br />\\nn\\\\\\\\\\ method is thelink#}ity}}}}String, String, and.
br>
nn\\\\n\\ Thisbr>\\nn\\\\n*\\ method of. of the... be a the file..\\\\\\\\\\\\\\br>\\nn\\tn\\\\br>\\.
.1.li>\\nn\\\\n\\\\br>\\.2.<li>\\nn\\\\n\\<br>\\.2.3.11.2.2.li>\\nn\\\\n\\<li>1.2.<11.2.<li>\\nn\\\\t\\<li>1n sierp@ing Testify
String) valuevalue"")"")"")"")"") beencard oneify"") wild a the) value, ""should""""oid"""",value,) String,))
@ static; Versions(1_,erMatchMatchWildCardCardifier,inalWWerBoundary,
[]ersorph}} ""should""""1.1APSAPest V = ""1.1.5.SN1.0.5.. Stringion1ed;value).javaing,ersions_String)rs,, StringV, "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * Loads the Pretty Faces configuration and returns the configuration\\\\n * object.\\\\n * \\\\n * @return Loaded configuration.\\\\n * @throws IOException\\\\n * If configuration could not be read.\\\\n * @throws SAXException\\\\n * If configuraion could not be parsed.\\\\n */', '')"", ""('', '// Load configurations from the class path\\n')"", ""('', '// Load configurations from the config files configured in the servlet\\n')"", ""('', '// context\\n')"", ""('', '// Load configuration from the default path\\n')""]
### Test JUnit in Java:
","@Test public void configureDefault() throws SAXException, IOException { final ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class); EasyMock.expect(servletContext.getInitParameter(PrettyFilter.CONFIG_FILES_ATTR)).andReturn(null).anyTimes(); EasyMock.expect(servletContext.getResourceAsStream(PrettyConfigurator.DEFAULT_PRETTY_FACES_CONFIG)).andReturn( null).anyTimes(); final ClassLoader resourceLoader = new URLClassLoader(new URL[0], Thread.currentThread() .getContextClassLoader()) { @Override public Enumeration<URL> getResources(final String name) throws IOException { if (PrettyConfigurator.PRETTY_CONFIG_RESOURCE.equals(name)) { return enumeration(mockPrettyConfigURL()); } else { return super.getResources(name); } } }; final PrettyConfigurator configurator = new PrettyConfigurator(servletContext) { @Override protected ClassLoader getResourceLoader","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisads a fileferencesPraces library from returns the configuration.\\n * instance.\\\\n *\\\\nn * @return theads configuration object\\\\n */ \throws Exception If\\n * If the file not be loaded.\\\\n */ @throws PreAXException\\\\n * If the fileion could not be parsed.\\\\n */\ '] ""public/** '\\', the\\ the classpath.\\',"", ""('', '// Load configurations from the class file\\ in the application contextn')"", ""('', '// Load.n')"", ""('', '// context configurations from the class location\\n')"",
### Ex:Unit: the:
sierpTest public public void test()() throws IOExceptionAXException, IOException { { Pre ConfigurationletContext contextContext = getasyMock.createMockiceMock(ServletContext.class); finalasyMock.expect(servletContext.getInitParameter(""PREttyF.DEFAULT_FILE_PATHT)).andReturn(null).anyTimes(); EasyMock.re(servletContext.getInitAsStream(PrettyFilter.ator.DEFAULT_CONFIGTTY_CONFIGACES_CONFIG_andReturn(null new).anyTimes(); E PreLoader classLoader = E ClassClassLoader(new URL[]0], null.currentThread().
.getContextClassLoader()); { @Override public URLumeration<URL> getResources(final String name) IOException { return (namettyConfigurator.DEFAULTTTY_F_FILESOURCE_equals(name)) { return Colation(new(ttyConfig());); } return { return super.getResources(name); } } }; E PrettyConfigurator configurator = new PrettyConfigurator(resourceContext, { @Override protected PreLoader getResourceLoader()"
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n\\\\t * @return the chronologically (based on result date) first result\\\\n\\\\t * @should get the first result given multiple results\\\\n\\\\t * @should get the result given a single result\\\\n\\\\t * @should get an empty result given an empty result\\\\n\\\\t * @should not get the result with null result date given other results\\\\n\\\\t * @should get one result with null result dates for all results\\\\n\\\\t */', '')"", ""('', '// default the returned result to the first item\\n')"", ""('', '// in case all resultDates are null\\n')""]
### Test JUnit in Java:
","@Test public void earliest_shouldGetAnEmptyResultGivenAnEmptyResult() throws Exception { Result parentResult = new EmptyResult(); Assert.assertEquals(new EmptyResult(), parentResult.earliest()); }","OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO sierp agram Inst ##ow. a anor
the
of a that the,
a
.....
TheThe# is:
##\\
n\\\\nn\\
param
ologicalically.\\) the))
..\\\\\\\\n\\\\return be the first result\\...\\\\\\\\n\\\\should get the first of\\ method.\\nn\\\\n\\\\should get the instruction the\\\\ empty result\\nn\\\\n\\@should get get the first of the\\\\\\ a results.\\n\\\\n\\@should get the of\\ the\\\\\\ the results\\\\n\\\\n\\@ '
'\\\\ ""\\\\' first the of get first result,\\\\
""\\\\ '\\\\ the of results isates\\ the.n\\\\
###'.
case.
## sierpshouldJ@ static
@ get theother shouldiven
otherResultG
.
} Result ResultptyResult} ion
ed(Object ObjectptyResult) newResult)
ly, @ "
"### Instruction:
Below is an instruction that describes a method or function in Java. Write the corresponding JUnit test case.
### Description:
[""('/**\\\\n * <p>\\\\n * detectDataFileType.\\\\n * </p>\\\\n *\\\\n * @param fileName a {@link java.io.File} object.\\\\n * @return a {@link io.github.msdk.datamodel.FileType} object.\\\\n * @throws java.io.IOException if any.\\\\n */', '')"", ""('', '// Parameter check\\n')"", ""('', '// To check for Waters .raw directory, we look for _FUNC[0-9]{3}.DAT\\n')"", '(\'\', ""// We don\'t recognize any other directory type than Waters\\n"")', ""('', '// Read the first 1kB of the file into a String\\n')""]
### Test JUnit in Java:
","@Test public void testMzDB() throws MSDKException, IOException { File fileName = new File(TEST_DATA_PATH + ""OVEMB150205_12.raw.0.9.8_truncated.mzDB""); FileType fileType = FileTypeDetectionAlgorithm.detectDataFileType(fileName); Assert.assertEquals(FileType.MZDB, fileType); }","nobody################rual
Hinweisow is a example on will how method of procedure. a.
a method methodav test that that
publicpublic# Inst:
Test]
n\\\\ public Thisp>Thisnn * ThissType.(java\\n * <p>\\\\n * <\\n * <param data the filelink java.lang.File} object.\\\\n * @return the {@link java.github.mx.dataatodel.DataType} object.\\\\n * @throws java.io.IOException if the.\\\\n *""] '] ""public/** 'public',:.\\ "", ""('', '// Return test the theAVhedw file\\ we need for therawOLC_0]9]1}raw\\n')"", ""//""', '// To look't care this file file type\\ Waters .n"")', ""('', '// Parameter the file line10 bytes of the file\\ a byte\\n')"",
### Inst:Unit: the:
sierpTest public public void testDetsMLFile throws IOExceptionzException { IOException {
File file = new File(""data_DATA_DIR + ""MME__.0001_0.0m"");m00.0.Funcated.mzdb""); FileType fileType = detectType.etection.orithm.detectDataFileType(fileName); assert.assertEquals(FileType.MZDB, fileType); } }
"
|