id
stringlengths
23
25
content
stringlengths
5.51k
455k
max_stars_repo_path
stringlengths
46
115
code_ujb_testgen_data_1
@Test public void testDecodeWithInnerPad() { final String content = "SGVsbG8gV29ybGQ=SGVsbG8gV29ybGQ="; final byte[] result = Base64.decodeBase64(content); final byte[] shouldBe = StringUtils.getBytesUtf8("Hello World"); assertTrue("decode should halt at pad (=)", Arrays.equals(r...
src/test/java/org/apache/commons/codec/binary/Base64Test.java
code_ujb_testgen_data_2
public void testDateConstructor1() { TimeZone zone = TimeZone.getTimeZone("GMT"); Calendar c = new GregorianCalendar(zone); Quarter q1 = new Quarter(new Date(1017619199999L), zone, Locale.getDefault()); Quarter q2 = new Quarter(new Date(1017619200000L), zone, L...
tests/org/jfree/data/time/junit/QuarterTests.java
code_ujb_testgen_data_3
public void testGetDomainBoundsWithInterval() { // check empty dataset TimePeriodValuesCollection dataset = new TimePeriodValuesCollection(); Range r = dataset.getDomainBounds(true); assertNull(r); // check dataset with one time period TimePeriodValues s1 = n...
tests/org/jfree/data/time/junit/TimePeriodValuesCollectionTests.java
code_ujb_testgen_data_4
public void testLocalType728() throws Exception { TypeFactory tf = TypeFactory.defaultInstance(); Method m = Issue728.class.getMethod("method", CharSequence.class); assertNotNull(m); // Start with return type // first type-erased JavaType t = tf.constructType(m.g...
src/test/java/com/fasterxml/jackson/databind/type/TestJavaType.java
code_ujb_testgen_data_5
public void testCollections() { // Ok, first: let's test what happens when we pass 'raw' Collection: TypeFactory tf = TypeFactory.defaultInstance(); JavaType t = tf.constructType(ArrayList.class); assertEquals(CollectionType.class, t.getClass()); assertSame(ArrayList.clas...
src/test/java/com/fasterxml/jackson/databind/type/TestTypeFactory.java
code_ujb_testgen_data_6
public void test2502355_zoomInRange() { DefaultXYDataset dataset = new DefaultXYDataset(); JFreeChart chart = ChartFactory.createXYLineChart("TestChart", "X", "Y", dataset, false); XYPlot plot = (XYPlot) chart.getPlot(); plot.setRangeAxis(1, new NumberAxis("X2")); ...
tests/org/jfree/chart/junit/ChartPanelTests.java
code_ujb_testgen_data_7
public void test1170825() { YIntervalSeries s1 = new YIntervalSeries("Series1"); YIntervalSeriesCollection dataset = new YIntervalSeriesCollection(); dataset.addSeries(s1); try { /* XYSeries s = */ dataset.getSeries(1); } catch (IllegalArgumentException e)...
tests/org/jfree/data/xy/junit/YIntervalSeriesCollectionTests.java
code_ujb_testgen_data_8
public void test2502355_restoreAutoDomainBounds() { DefaultXYDataset dataset = new DefaultXYDataset(); JFreeChart chart = ChartFactory.createXYLineChart("TestChart", "X", "Y", dataset, false); XYPlot plot = (XYPlot) chart.getPlot(); plot.setDomainAxis(1, new NumberAxi...
tests/org/jfree/chart/junit/ChartPanelTests.java
code_ujb_testgen_data_9
@Test public void testConstructorPlusAdd() { final FixedOrderComparator<String> comparator = new FixedOrderComparator<String>(); for (final String topCitie : topCities) { comparator.add(topCitie); } final String[] keys = topCities.clone(); assertComparatorYiel...
src/test/java/org/apache/commons/collections4/comparators/FixedOrderComparatorTest.java
code_ujb_testgen_data_10
public void testFifteenMinSegmentedTimeline() { assertEquals(SegmentedTimeline.FIFTEEN_MINUTE_SEGMENT_SIZE, this.fifteenMinTimeline.getSegmentSize()); assertEquals(SegmentedTimeline.FIRST_MONDAY_AFTER_1900 + 36 * this.fifteenMinTimeline.getSegmentSize(), ...
tests/org/jfree/chart/axis/junit/SegmentedTimelineTests.java
code_ujb_testgen_data_11
@Test public void testReflectionArrayAndObjectCycle() throws Exception { final Object[] objects = new Object[1]; final SimpleReflectionTestFixture simple = new SimpleReflectionTestFixture(objects); objects[0] = simple; assertEquals( this.toBaseString(objects) ...
src/test/java/org/apache/commons/lang3/builder/ToStringBuilderTest.java
code_ujb_testgen_data_12
@Test public void testTwoArgumentErf() { double[] xi = new double[]{-2.0, -1.0, -0.9, -0.1, 0.0, 0.1, 0.9, 1.0, 2.0}; for(double x1 : xi) { for(double x2 : xi) { double a = Erf.erf(x1, x2); double b = Erf.erf(x2) - Erf.erf(x1); double c...
src/test/java/org/apache/commons/math3/special/ErfTest.java
code_ujb_testgen_data_13
@Test public void testDecodeObjectException() { try { this.instance.decode(new Object()); } catch (final DecoderException e) { // all is well. return; } fail("Expected DecoderException"); } // // Abstract Java Tested Class // package org.a...
src/test/java/org/apache/commons/codec/binary/BinaryCodecTest.java
code_ujb_testgen_data_14
public void testSerializeDeserializeWithJaxbAnnotations() throws Exception { ObjectMapper mapper = new ObjectMapper(); mapper.enable(SerializationFeature.INDENT_OUTPUT); JacksonExample ex = new JacksonExample(); QName qname = new QName("urn:hi", "hello"); ex.setQname(qnam...
src/test/java/com/fasterxml/jackson/databind/introspect/TestJacksonAnnotationIntrospector.java
code_ujb_testgen_data_15
public void testProps() { ObjectMapper m = new ObjectMapper(); // should have default factory assertNotNull(m.getNodeFactory()); JsonNodeFactory nf = new JsonNodeFactory(true); m.setNodeFactory(nf); assertNull(m.getInjectableValues()); assertSame(nf, m.get...
src/test/java/com/fasterxml/jackson/databind/ObjectMapperTest.java
code_ujb_testgen_data_16
@Test public void testEscapeHtmlHighUnicode() throws java.io.UnsupportedEncodingException { // this is the utf8 representation of the character: // COUNTING ROD UNIT DIGIT THREE // in Unicode // codepoint: U+1D362 final byte[] data = new byte[] { (byte)0xF0, (byte)0x9D, (...
src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
code_ujb_testgen_data_17
public void testCreateCategoryDataset2() { boolean pass = false; String[] rowKeys = {"R1", "R2", "R3"}; String[] columnKeys = {"C1", "C2"}; double[][] data = new double[2][]; data[0] = new double[] {1.1, 1.2, 1.3}; data[1] = new double[] {2.1, 2.2, 2.3}; Categ...
tests/org/jfree/data/general/junit/DatasetUtilitiesTests.java
code_ujb_testgen_data_18
@Test public void testErfcGnu() { final double tol = 1E-15; final double[] gnuValues = new double[] { 2, 2, 2, 2, 2, 2, 2, 2, 1.9999999999999999785, 1.9999999999999926422, 1.9999999999984625402, 1.9999999998033839558, 1.9999999845827420998, 1.9999992569016276586,...
src/test/java/org/apache/commons/math3/special/ErfTest.java
code_ujb_testgen_data_19
@Test public void testErfcMaple() { double[][] ref = new double[][] {{0.1, 4.60172162722971e-01}, {1.2, 1.15069670221708e-01}, {2.3, 1.07241100216758e-02}, {3.4, 3.36929265676881e-04}, ...
src/test/java/org/apache/commons/math3/special/ErfTest.java
code_ujb_testgen_data_20
public void testPreviousStandardDateDayB() { MyDateAxis axis = new MyDateAxis("Day"); Day apr12007 = new Day(1, 4, 2007); Day apr22007 = new Day(2, 4, 2007); // five dates to check... Date d0 = new Date(apr12007.getFirstMillisecond()); Date d1 = new Date(apr12007.get...
tests/org/jfree/chart/axis/junit/DateAxisTests.java
code_ujb_testgen_data_21
public void testCycles2() { DiGraph<String, String> g = LinkedDirectedGraph.create(); g.createDirectedGraphNode("a"); g.createDirectedGraphNode("b"); g.createDirectedGraphNode("c"); g.createDirectedGraphNode("d"); g.connect("a", "-", "b"); g.connect("b", "-", "c"); g.connect("c", "-",...
test/com/google/javascript/jscomp/CheckPathsBetweenNodesTest.java
code_ujb_testgen_data_22
@Test public void testRfc4648Section10Decode() { assertEquals("", StringUtils.newStringUsAscii(Base64.decodeBase64(""))); assertEquals("f", StringUtils.newStringUsAscii(Base64.decodeBase64("Zg=="))); assertEquals("fo", StringUtils.newStringUsAscii(Base64.decodeBase64("Zm8="))); a...
src/test/java/org/apache/commons/codec/binary/Base64Test.java
code_ujb_testgen_data_23
public void test2502355_zoomInDomain() { DefaultXYDataset dataset = new DefaultXYDataset(); JFreeChart chart = ChartFactory.createXYLineChart("TestChart", "X", "Y", dataset, false); XYPlot plot = (XYPlot) chart.getPlot(); plot.setDomainAxis(1, new NumberAxis("X2")); ...
tests/org/jfree/chart/junit/ChartPanelTests.java
code_ujb_testgen_data_24
@Test public void testPutKeysWithCollision2() { OpenIntToDoubleHashMap map = new OpenIntToDoubleHashMap(); int key1 = 837989881; double value1 = 1.0; map.put(key1, value1); int key2 = 476463321; map.put(key2, value1); Assert.assertEquals(2, map.size()); ...
src/test/java/org/apache/commons/math3/util/OpenIntToDoubleHashMapTest.java
code_ujb_testgen_data_25
public void testAddSeries() { DefaultTableXYDataset d1 = new DefaultTableXYDataset(); d1.setAutoWidth(true); XYSeries s1 = new XYSeries("Series 1", true, false); s1.add(3.0, 1.1); s1.add(7.0, 2.2); d1.addSeries(s1); assertEquals(3.0, d1.getXValue(0, 0), EPSILO...
tests/org/jfree/data/xy/junit/DefaultTableXYDatasetTests.java
code_ujb_testgen_data_26
@Test(expected = NoSuchElementException.class) public void testResultIsExceptionUnknown() throws ConcurrentException { final MultiBackgroundInitializer.MultiBackgroundInitializerResults res = checkInitialize(); res.isException("unknown"); } // // Abstract Java Tested Class // package org.ap...
src/test/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializerTest.java
code_ujb_testgen_data_27
@Test public void testfirstDerivativeComparison() { double[] f_coeff = { 3, 6, -2, 1 }; double[] g_coeff = { 6, -4, 3 }; double[] h_coeff = { -4, 6 }; PolynomialFunction f = new PolynomialFunction(f_coeff); PolynomialFunction g = new PolynomialFunction(g_coeff); ...
src/test/java/org/apache/commons/math3/analysis/polynomials/PolynomialFunctionTest.java
code_ujb_testgen_data_28
@Test public void testNthRoot_normal_fourthRoot() { // The complex number we want to compute all third-roots for. Complex z = new Complex(5,-2); // The List holding all fourth roots Complex[] fourthRootsOfZ = z.nthRoot(4).toArray(new Complex[0]); // Returned Collection mu...
src/test/java/org/apache/commons/math3/complex/ComplexTest.java
code_ujb_testgen_data_29
@Test public void testRemoveUnsupported() { Iterator<E> mockIterator = new AbstractIteratorDecorator<E>(testList.iterator()) { @Override public void remove() { throw new UnsupportedOperationException(); } }; Iterator<E> iter = new Boun...
src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
code_ujb_testgen_data_30
@Test public void testCovarianceConsistency() { RealMatrix matrix = createRealMatrix(longleyData, 16, 7); PearsonsCorrelation corrInstance = new PearsonsCorrelation(matrix); Covariance covInstance = new Covariance(matrix); PearsonsCorrelation corrFromCovInstance = new PearsonsCor...
src/test/java/org/apache/commons/math3/stat/correlation/PearsonsCorrelationTest.java
code_ujb_testgen_data_31
public void testEqualsWithLocale() { PeriodAxis a1 = new PeriodAxis("Test", new Year(2000), new Year(2009), TimeZone.getDefault(), Locale.JAPAN); PeriodAxis a2 = new PeriodAxis("Test", new Year(2000), new Year(2009), TimeZone.getDefault(), Locale.JAPAN); asser...
tests/org/jfree/chart/axis/junit/PeriodAxisTests.java
code_ujb_testgen_data_32
@Test public void testMath341() { double[] f_coeff = { 3, 6, -2, 1 }; double[] g_coeff = { 6, -4, 3 }; double[] h_coeff = { -4, 6 }; PolynomialFunction f = new PolynomialFunction(f_coeff); PolynomialFunction g = new PolynomialFunction(g_coeff); PolynomialFunction...
src/test/java/org/apache/commons/math3/analysis/polynomials/PolynomialFunctionTest.java
code_ujb_testgen_data_33
@Test public void testKeepInitIfBest() { final double minSin = 3 * Math.PI / 2; final double offset = 1e-8; final double delta = 1e-7; final UnivariateFunction f1 = new Sin(); final UnivariateFunction f2 = new StepFunction(new double[] { minSin, minSin + offset, minSin + ...
src/test/java/org/apache/commons/math3/optimization/univariate/BrentOptimizerTest.java
code_ujb_testgen_data_34
@Test public void testAdHocData() { FastFourierTransformer transformer; transformer = new FastFourierTransformer(DftNormalization.STANDARD); Complex result[]; double tolerance = 1E-12; double x[] = {1.3, 2.4, 1.7, 4.1, 2.9, 1.7, 5.1, 2.7}; Complex y[] = { new...
src/test/java/org/apache/commons/math3/transform/FastFourierTransformerTest.java
code_ujb_testgen_data_35
public void testAutoRange1() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.setValue(100.0, "Row 1", "Column 1"); dataset.setValue(200.0, "Row 1", "Column 2"); JFreeChart chart = ChartFactory.createBarChart("Test", "Categories", "Value", data...
tests/org/jfree/chart/axis/junit/LogAxisTests.java
code_ujb_testgen_data_36
public void testBug901455() throws Exception { testTypes("/** @return {(number,undefined)} */ function a() { return 3; }" + "var b = undefined === a()"); testTypes("/** @return {(number,undefined)} */ function a() { return 3; }" + "var b = a() === undefined"); } // public void testLends3(...
test/com/google/javascript/jscomp/TypeCheckTest.java
code_ujb_testgen_data_37
@Test(expected = NoSuchElementException.class) public void testResultGetExceptionUnknown() throws ConcurrentException { final MultiBackgroundInitializer.MultiBackgroundInitializerResults res = checkInitialize(); res.getException("unknown"); } // // Abstract Java Tested Class // package org....
src/test/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializerTest.java
code_ujb_testgen_data_38
public void testGoodParse() { final String CONTENTS = "/*" + "goog.addDependency('no1', [], []);*//*\n" + "goog.addDependency('no2', [ ], [ ]);\n" + "*/goog.addDependency('yes1', [], []);\n" + "/* blah */goog.addDependency(\"yes2\", [], [])/* blah*/\n" + "goog.addDependency...
test/com/google/javascript/jscomp/deps/DepsFileParserTest.java
code_ujb_testgen_data_39
@Test public void testUsMappingOWithDiaeresis() { Assert.assertEquals("O000", this.getStringEncoder().encode("o")); if (Character.isLetter('\u00f6')) { // o-umlaut try { // uppercase O-umlaut Assert.assertEquals("\u00d6000", this.getStringEncod...
src/test/java/org/apache/commons/codec/language/SoundexTest.java
code_ujb_testgen_data_40
@Test public void testParaboloid2D() { MultivariateFunction f = new MultivariateFunction() { public double value(double[] x) { if (x.length != 2) { throw new IllegalArgumentException(); } return 2 * x[0] ...
src/test/java/org/apache/commons/math3/analysis/interpolation/MicrosphereInterpolatorTest.java
code_ujb_testgen_data_41
@Test public void testBevington() { final double[][] dataPoints = { // column 1 = times { 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210, 225, 240, 255, 270, 285, 300, 315, 330, 345, 360, 375, 390, 405, 420, 435, 450, 465,...
src/test/java/org/apache/commons/math3/optimization/general/LevenbergMarquardtOptimizerTest.java
code_ujb_testgen_data_42
@Test public void testAvailableLocaleSet() { final Set<Locale> set = LocaleUtils.availableLocaleSet(); final Set<Locale> set2 = LocaleUtils.availableLocaleSet(); assertNotNull(set); assertSame(set, set2); assertUnmodifiableCollection(set); final Locale[] ...
src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java
code_ujb_testgen_data_43
public void testPreviousStandardDateHourB() { MyDateAxis axis = new MyDateAxis("Hour"); Hour h0 = new Hour(12, 1, 4, 2007); Hour h1 = new Hour(13, 1, 4, 2007); // five dates to check... Date d0 = new Date(h0.getFirstMillisecond()); Date d1 = new Date(h0.getFirstMilli...
tests/org/jfree/chart/axis/junit/DateAxisTests.java
code_ujb_testgen_data_44
public void testMethodsThatShouldAlwaysReturnNull() { DateTimeField fieldOne = UnsupportedDateTimeField.getInstance( dateTimeFieldTypeOne, UnsupportedDurationField .getInstance(weeks)); assertNull(fieldOne.getLeapDurationField()); assertNull(fieldOne....
src/test/java/org/joda/time/field/TestUnsupportedDateTimeField.java
code_ujb_testgen_data_45
public void testPreviousStandardDateYearB() { MyDateAxis axis = new MyDateAxis("Year"); Year y2006 = new Year(2006); Year y2007 = new Year(2007); // five dates to check... Date d0 = new Date(y2006.getFirstMillisecond()); Date d1 = new Date(y2006.getFirstMillisecond()...
tests/org/jfree/chart/axis/junit/DateAxisTests.java
code_ujb_testgen_data_46
@Test public void testLocaleLookupList_Locale() { assertLocaleLookupList(null, null, new Locale[0]); assertLocaleLookupList(LOCALE_QQ, null, new Locale[]{LOCALE_QQ}); assertLocaleLookupList(LOCALE_EN, null, new Locale[]{LOCALE_EN}); assertLocaleLookupList(LOCALE_EN, null, new Loc...
src/test/java/org/apache/commons/lang3/LocaleUtilsTest.java
code_ujb_testgen_data_47
@Test public void testPutIfAbsentKeyPresent() { final String key = "testKey"; final Integer value = 42; final ConcurrentMap<String, Integer> map = new ConcurrentHashMap<String, Integer>(); map.put(key, value); assertEquals("Wrong result", value, Concurrent...
src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java
code_ujb_testgen_data_48
@Test public void testNextDigest() throws Exception { double next = 0.0; double tolerance = 0.1; vs.computeDistribution(); Assert.assertTrue("empirical distribution property", vs.getEmpiricalDistribution() != null); SummaryStatistics stats = new SummaryStatist...
src/test/java/org/apache/commons/math3/random/ValueServerTest.java
code_ujb_testgen_data_49
public void testCanInlineReferenceToFunctionInExpression18() { // Call in within a call helperCanInlineReferenceToFunction(CanInlineResult.AFTER_PREPARATION, "function foo(){return _g();}; " + "function x() {1 + foo()() }", "foo", INLINE_BLOCK, true); } // CanInlineResult.YES;...
test/com/google/javascript/jscomp/FunctionInjectorTest.java
code_ujb_testgen_data_50
public void testUnaliasable() { test("function foo() {" + "var x=arguments.length;" + "var y=arguments.length;" + "var z=arguments.length;" + "var w=arguments.length;" + "return x + y + z + w" + "};foo();", formatPropNameDecl("length") + ...
test/com/google/javascript/jscomp/AliasExternalsTest.java
code_ujb_testgen_data_51
public void testPrettyPrinter() throws Exception { ObjectWriter writer = MAPPER.writer(); HashMap<String, Integer> data = new HashMap<String,Integer>(); data.put("a", 1); // default: no indentation assertEquals("{\"a\":1}", writer.writeValueAsString(data)); ...
src/test/java/com/fasterxml/jackson/databind/ObjectWriterTest.java
code_ujb_testgen_data_52
public void test2502355_restoreAutoRangeBounds() { DefaultXYDataset dataset = new DefaultXYDataset(); JFreeChart chart = ChartFactory.createXYLineChart("TestChart", "X", "Y", dataset, false); XYPlot plot = (XYPlot) chart.getPlot(); plot.setRangeAxis(1, new NumberAxis(...
tests/org/jfree/chart/junit/ChartPanelTests.java
code_ujb_testgen_data_53
@Test public void testCompressionMethod() throws Exception { final ZipArchiveOutputStream zos = new ZipArchiveOutputStream(new ByteArrayOutputStream()); final ZipArchiveEntry entry = new ZipArchiveEntry("foo"); assertEquals(-1, entry.getMethod()); assertFalse(zos.canW...
src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
code_ujb_testgen_data_54
@Test public void testNullCommentEqualsEmptyComment() { final ZipArchiveEntry entry1 = new ZipArchiveEntry("foo"); final ZipArchiveEntry entry2 = new ZipArchiveEntry("foo"); final ZipArchiveEntry entry3 = new ZipArchiveEntry("foo"); entry1.setComment(null); entry2.setComm...
src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
code_ujb_testgen_data_55
public void testRenameProperties() { test("var foo; foo.prop_='bar'", "var foo;foo.a='bar'"); test("this.prop_='bar'", "this.a='bar'"); test("this.prop='bar'", "this.prop='bar'"); test("this['prop_']='bar'", "this['a']='bar'"); test("this['prop']='bar'", "this['prop']='bar'"); test("var foo={p...
test/com/google/javascript/jscomp/RenamePrototypesTest.java
code_ujb_testgen_data_56
@Test public void testErfGnu() { final double tol = 1E-15; final double[] gnuValues = new double[] {-1, -1, -1, -1, -1, -1, -1, -1, -0.99999999999999997848, -0.99999999999999264217, -0.99999999999846254017, -0.99999999980338395581, -0.99999998458274209971, -0.999999256...
src/test/java/org/apache/commons/math3/special/ErfTest.java
code_ujb_testgen_data_57
@Test public void testParaboloid() { BivariateFunction f = new BivariateFunction() { public double value(double x, double y) { return 2 * x * x - 3 * y * y + 4 * x * y - 5 + ((int) (FastMath.abs(5 * x + 3 * y)) % 2 == 0 ? 1 : -1); ...
src/test/java/org/apache/commons/math3/analysis/interpolation/SmoothingPolynomialBicubicSplineInterpolatorTest.java
code_ujb_testgen_data_58
@Test public void testOffsetGreaterThanSize() { Iterator<E> iter = new BoundedIterator<E>(testList.iterator(), 10, 4); assertFalse(iter.hasNext()); try { iter.next(); fail("Expected NoSuchElementException."); } catch (NoSuchElementException nsee) { /* Succ...
src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
code_ujb_testgen_data_59
public void testDrawWithNullMeanVertical() { boolean success = false; try { DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset(); dataset.add(1.0, 2.0, "S1", "C1"); dataset.add(null, new Double(4.0), "S1", "C2"); ...
tests/org/jfree/chart/renderer/category/junit/StatisticalBarRendererTests.java
code_ujb_testgen_data_60
public void testBasicSegmentedTimeline() { SegmentedTimeline stl = new SegmentedTimeline(10, 2, 3); stl.setStartTime(946684800000L); // 1-Jan-2000 assertFalse(stl.containsDomainValue(946684799999L)); assertTrue(stl.containsDomainValue(946684800000L)); assertTrue(stl.contains...
tests/org/jfree/chart/axis/junit/SegmentedTimelineTests.java
code_ujb_testgen_data_61
public void testBugX() { RectangleConstraint constraint = new RectangleConstraint( new Range(0.0, 200.0), new Range(0.0, 100.0)); BlockContainer container = new BlockContainer(new BorderArrangement()); BufferedImage image = new BufferedImage(200, 100, Buffered...
tests/org/jfree/chart/block/junit/BorderArrangementTests.java
code_ujb_testgen_data_62
@Test public void testHWRuleEx3() throws EncoderException { Assert.assertEquals("S460", this.getStringEncoder().encode("Sgler")); Assert.assertEquals("S460", this.getStringEncoder().encode("Swhgler")); // Also S460: this.checkEncodingVariations("S460", new String[]{ "...
src/test/java/org/apache/commons/codec/language/SoundexTest.java
code_ujb_testgen_data_63
@Test public void testInitializeEx() throws ConcurrentException { final ChildBackgroundInitializer child = new ChildBackgroundInitializer(); child.ex = new Exception(); initializer.addInitializer(CHILD_INIT, child); initializer.start(); final MultiBackgroundInitializer.Mu...
src/test/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializerTest.java
code_ujb_testgen_data_64
public void testBug911118() throws Exception { // verifying the type assigned to function expressions assigned variables Scope s = parseAndTypeCheckWithScope("var a = function(){};").scope; JSType type = s.getVar("a").getType(); assertEquals("function (): undefined", type.toString()); // verifyin...
test/com/google/javascript/jscomp/TypeCheckTest.java
code_ujb_testgen_data_65
@Test public void testRegressAirlineConstantExternal() { MillerUpdatingRegression instance = new MillerUpdatingRegression(4, false); double[][] x = new double[airdata[0].length][]; double[] y = new double[airdata[0].length]; for (int i = 0; i < airdata[0].length; i++) { ...
src/test/java/org/apache/commons/math3/stat/regression/MillerUpdatingRegressionTest.java
code_ujb_testgen_data_66
@Test public void testNthRoot_cornercase_thirdRoot_realPartZero() { // complex number with only imaginary part Complex z = new Complex(0,2); // The List holding all third roots Complex[] thirdRootsOfZ = z.nthRoot(3).toArray(new Complex[0]); // Returned Collection must not...
src/test/java/org/apache/commons/math3/complex/ComplexTest.java
code_ujb_testgen_data_67
public void testLooping2() throws Exception { final List<String> list = Arrays.asList("a", "b"); final LoopingIterator<String> loop = new LoopingIterator<String>(list); assertTrue("1st hasNext should return true", loop.hasNext()); assertEquals("a", loop.next()); assertTrue(...
src/test/java/org/apache/commons/collections4/iterators/LoopingIteratorTest.java
code_ujb_testgen_data_68
@Override @Test public void testDensityIntegrals() { final RealDistribution distribution = makeDistribution(); final double tol = 1.0e-9; final BaseAbstractUnivariateIntegrator integrator = new IterativeLegendreGaussIntegrator(5, 1.0e-12, 1.0e-10); final Univariat...
src/test/java/org/apache/commons/math3/random/EmpiricalDistributionTest.java
code_ujb_testgen_data_69
@Test public void testRemoveLast() { List<E> testListCopy = new ArrayList<E>(testList); Iterator<E> iter = new SkippingIterator<E>(testListCopy.iterator(), 5); assertTrue(iter.hasNext()); assertEquals("f", iter.next()); assertTrue(iter.hasNext()); assertEquals("g...
src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
code_ujb_testgen_data_70
public void testBug2849731_2() { XYIntervalSeriesCollection d = new XYIntervalSeriesCollection(); XYIntervalSeries s = new XYIntervalSeries("S1"); s.add(1.0, Double.NaN, Double.NaN, Double.NaN, 1.5, Double.NaN); d.addSeries(s); Range r = DatasetUtilities.iterateDomainBounds(d...
tests/org/jfree/data/general/junit/DatasetUtilitiesTests.java
code_ujb_testgen_data_71
public void testAutoRange4() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.setValue(100.0, "Row 1", "Column 1"); dataset.setValue(200.0, "Row 1", "Column 2"); JFreeChart chart = ChartFactory.createBarChart("Test", "Categories", "Value", data...
tests/org/jfree/chart/axis/junit/NumberAxisTests.java
code_ujb_testgen_data_72
@Test public void testDegenerateNoFailures() { HypergeometricDistribution dist = new HypergeometricDistribution(5,5,3); setDistribution(dist); setCumulativeTestPoints(new int[] {-1, 0, 1, 3, 10 }); setCumulativeTestValues(new double[] {0d, 0d, 0d, 1d, 1d}); setDensityTest...
src/test/java/org/apache/commons/math3/distribution/HypergeometricDistributionTest.java
code_ujb_testgen_data_73
@Test public void testModelWithNoArtificialVars() { LinearObjectiveFunction f = new LinearObjectiveFunction(new double[] { 15, 10 }, 0); Collection<LinearConstraint> constraints = new ArrayList<LinearConstraint>(); constraints.add(new LinearConstraint(new double[] { 1, 0 }, Relationship....
src/test/java/org/apache/commons/math3/optim/linear/SimplexSolverTest.java
code_ujb_testgen_data_74
@Test public void testWithBytesAfterData() throws Exception { final int expectedNumEntries = 2; final InputStream is = ZipArchiveInputStreamTest.class .getResourceAsStream("/archive_with_bytes_after_data.zip"); final ZipArchiveInputStream zip = new ZipArchiveInputStream(i...
src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStreamTest.java
code_ujb_testgen_data_75
public void testExportDontEmitPrototypePathPrefix() { compileAndCheck( "/**\n" + " * @constructor\n" + " */\n" + "var Foo = function() {};" + "/**\n" + " * @return {number}\n" + " */\n" + "Foo.prototype.m = function() {return 6;};\n" + "goog....
test/com/google/javascript/jscomp/ExternExportsPassTest.java
code_ujb_testgen_data_76
public void testParseFile() { final String CONTENTS = "/*" + "goog.provide('no1');*//*\n" + "goog.provide('no2');\n" + "*/goog.provide('yes1');\n" + "/* blah */goog.provide(\"yes2\")/* blah*/\n" + "goog.require('yes3'); // goog.provide('no3');\n" + "// goog.provide('no4');\n" ...
test/com/google/javascript/jscomp/deps/JsFunctionParserTest.java
code_ujb_testgen_data_77
public void testLooping3() throws Exception { final List<String> list = Arrays.asList("a", "b", "c"); final LoopingIterator<String> loop = new LoopingIterator<String>(list); assertTrue("1st hasNext should return true", loop.hasNext()); assertEquals("a", loop.next()); assert...
src/test/java/org/apache/commons/collections4/iterators/LoopingIteratorTest.java
code_ujb_testgen_data_78
public void testSerialization3() { XYSeriesCollection dataset = new XYSeriesCollection(); JFreeChart chart = ChartFactory.createXYLineChart("Test Chart", "Domain Axis", "Range Axis", dataset, true); JFreeChart chart2 = null; // serialize and deserialize the chart.....
tests/org/jfree/chart/plot/junit/XYPlotTests.java
code_ujb_testgen_data_79
@Test public void testReadingOfFirstStoredEntry() throws Exception { final File archive = getFile("COMPRESS-264.zip"); zf = new ZipFile(archive); final ZipArchiveEntry ze = zf.getEntry("test.txt"); assertEquals(5, ze.getSize()); assertArrayEquals(new byte[] {'d', 'a', 't'...
src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
code_ujb_testgen_data_80
public void testCreateObjectType() throws Exception { // simple ObjectType subDate = registry.createObjectType(DATE_TYPE.getImplicitPrototype()); assertTypeEquals(DATE_TYPE.getImplicitPrototype(), subDate.getImplicitPrototype()); assertNull(subDate.getReferenceName()); assertEquals...
test/com/google/javascript/rhino/jstype/JSTypeTest.java
code_ujb_testgen_data_81
@Test public void testAcquireMultipleThreads() throws InterruptedException { final ScheduledExecutorService service = EasyMock .createMock(ScheduledExecutorService.class); final ScheduledFuture<?> future = EasyMock.createMock(ScheduledFuture.class); prepareStartTimer(serv...
src/test/java/org/apache/commons/lang3/concurrent/TimedSemaphoreTest.java
code_ujb_testgen_data_82
@Test public void testBuiltInChoiceFormat() { final Object[] values = new Number[] {Integer.valueOf(1), Double.valueOf("2.2"), Double.valueOf("1234.5")}; String choicePattern = null; final Locale[] availableLocales = ChoiceFormat.getAvailableLocales(); choicePattern = "{0,choice...
src/test/java/org/apache/commons/lang3/text/ExtendedMessageFormatTest.java
code_ujb_testgen_data_83
public void testPropertyBasedBeanInstantiator() throws Exception { ObjectMapper mapper = new ObjectMapper(); mapper.registerModule(new MyModule(CreatorBean.class, new InstantiatorBase() { @Override public boolean canCreateFromObjectWith() {...
src/test/java/com/fasterxml/jackson/databind/deser/creators/TestValueInstantiator.java
code_ujb_testgen_data_84
public void testWeek12005() { Week w1 = new Week(1, 2005); Calendar c1 = Calendar.getInstance( TimeZone.getTimeZone("Europe/London"), Locale.UK); c1.setMinimalDaysInFirstWeek(4); // see Java Bug ID 4960215 assertEquals(1104710400000L, w1.getFirstMillisecond(c1)); ...
tests/org/jfree/data/time/junit/WeekTests.java
code_ujb_testgen_data_85
@Test public void testGetOneLineOneParser() throws IOException { final CSVFormat format = CSVFormat.DEFAULT; try (final PipedWriter writer = new PipedWriter(); final CSVParser parser = new CSVParser(new PipedReader(writer), format)) { writer.append(CSV_INPUT_1); ...
src/test/java/org/apache/commons/csv/CSVParserTest.java
code_ujb_testgen_data_86
public void test1472942() { DateAxis a1 = new DateAxis("Test"); DateAxis a2 = new DateAxis("Test"); assertTrue(a1.equals(a2)); // range a1.setRange(new Date(1L), new Date(2L)); assertFalse(a1.equals(a2)); a2.setRange(new Date(1L), new Date(2L)); asser...
tests/org/jfree/chart/axis/junit/DateAxisTests.java
code_ujb_testgen_data_87
public void testSupertypeOfProxiedFunctionTypes() { ObjectType fn1 = new FunctionBuilder(registry) .withParamsNode(new Node(Token.PARAM_LIST)) .withReturnType(NUMBER_TYPE) .build(); ObjectType fn2 = new FunctionBuilder(registry) .withParamsNode(new Node(Token.PA...
test/com/google/javascript/rhino/jstype/JSTypeTest.java
code_ujb_testgen_data_88
@Test public void testRemoveMiddle() { List<E> testListCopy = new ArrayList<E>(testList); Iterator<E> iter = new BoundedIterator<E>(testListCopy.iterator(), 1, 5); assertTrue(iter.hasNext()); assertEquals("b", iter.next()); assertTrue(iter.hasNext()); assertEqual...
src/test/java/org/apache/commons/collections4/iterators/BoundedIteratorTest.java
code_ujb_testgen_data_89
public void testDifferentDurationReturnDifferentObjects() { /** * The fields returned by getInstance should be the same when the * duration is the same for both method calls. */ DateTimeField fieldOne = UnsupportedDateTimeField.getInstance( dateTimeFieldTy...
src/test/java/org/joda/time/field/TestUnsupportedDateTimeField.java
code_ujb_testgen_data_90
@Test public void testRemoveCalledTwice() { List<E> testListCopy = new ArrayList<E>(testList); Iterator<E> iter = new SkippingIterator<E>(testListCopy.iterator(), 1); assertTrue(iter.hasNext()); assertEquals("b", iter.next()); iter.remove(); try { it...
src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
code_ujb_testgen_data_91
public void testIterateRangeBounds4() { YIntervalSeriesCollection dataset = new YIntervalSeriesCollection(); Range r = DatasetUtilities.iterateRangeBounds(dataset); assertNull(r); YIntervalSeries s1 = new YIntervalSeries("S1"); dataset.addSeries(s1); r = DatasetUtilit...
tests/org/jfree/data/general/junit/DatasetUtilitiesTests.java
code_ujb_testgen_data_92
@Test public void testAggregate() { // Generate a random sample and random partition double[] totalSample = generateSample(); double[][] subSamples = generatePartition(totalSample); int nSamples = subSamples.length; // Compute combined stats directly SummaryStat...
src/test/java/org/apache/commons/math3/stat/descriptive/AggregateSummaryStatisticsTest.java
code_ujb_testgen_data_93
@Test public void testRemoveFirst() { List<E> testListCopy = new ArrayList<E>(testList); Iterator<E> iter = new SkippingIterator<E>(testListCopy.iterator(), 4); assertTrue(iter.hasNext()); assertEquals("e", iter.next()); iter.remove(); assertFalse(testListCopy.c...
src/test/java/org/apache/commons/collections4/iterators/SkippingIteratorTest.java
code_ujb_testgen_data_94
@Test public void testAggregationConsistency() { // Generate a random sample and random partition double[] totalSample = generateSample(); double[][] subSamples = generatePartition(totalSample); int nSamples = subSamples.length; // Create aggregator and total stats for ...
src/test/java/org/apache/commons/math3/stat/descriptive/AggregateSummaryStatisticsTest.java
code_ujb_testgen_data_95
public void testUnterminatedStringFailure() throws IOException { JsonReader reader = new JsonReader(reader("[\"string")); reader.setLenient(true); reader.beginArray(); assertEquals(JsonToken.STRING, reader.peek()); try { reader.nextString(); fail(); } catch (MalformedJsonException ...
gson/src/test/java/com/google/gson/stream/JsonReaderTest.java
code_ujb_testgen_data_96
@Test public void testCaverphoneRevisitedCommonCodeAT1111() throws EncoderException { this.checkEncodingVariations("AT1111", new String[]{ "add", "aid", "at", "art", "eat", "earth", "head", "hit", ...
src/test/java/org/apache/commons/codec/language/Caverphone1Test.java
code_ujb_testgen_data_97
public void testRemoving1() throws Exception { final List<String> list = new ArrayList<String>(Arrays.asList("a", "b", "c")); final LoopingIterator<String> loop = new LoopingIterator<String>(list); assertEquals("list should have 3 elements.", 3, list.size()); assertTrue("1st hasNext...
src/test/java/org/apache/commons/collections4/iterators/LoopingIteratorTest.java
code_ujb_testgen_data_98
public void test1553088() { double[] values = {-1.0, 0.0, -Double.MIN_VALUE, 3.0}; HistogramDataset d = new HistogramDataset(); d.addSeries("S1", values, 2, -1.0, 0.0); assertEquals(-1.0, d.getStartXValue(0, 0), EPSILON); assertEquals(-0.5, d.getEndXValue(0, 0), EPSILON); ...
tests/org/jfree/data/statistics/junit/HistogramDatasetTests.java
code_ujb_testgen_data_99
@Test public void testConsistency() { final RealMatrix matrix = createRealMatrix(swissData, 47, 5); final RealMatrix covarianceMatrix = new Covariance(matrix).getCovarianceMatrix(); // Variances on the diagonal Variance variance = new Variance(); for (int i = 0; i < 5; i...
src/test/java/org/apache/commons/math3/stat/correlation/CovarianceTest.java
code_ujb_testgen_data_100
@Test public void testConcurrentCreation() throws InterruptedException, ExecutionException { // Number of times the same rule will be called. final int numTasks = 20; final ThreadPoolExecutor exec = new ThreadPoolExecut...
src/test/java/org/apache/commons/math3/analysis/integration/gauss/BaseRuleFactoryTest.java