SimpleName:IDENTIFIER 302 expected expected

SimpleName:IDENTIFIER 302 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 303 unsupportedActionType$simple unsupportedActionType$simple

SimpleName:IDENTIFIER 306 formatTo formatTo

SimpleName:IDENTIFIER 306 Formatter Formatter

SimpleName:IDENTIFIER 306 formatter formatter

SimpleName:IDENTIFIER 306 precision precision

SimpleName:IDENTIFIER 307 formatter formatter

SimpleName:IDENTIFIER 307 toString toString

{
    formatter.format(this.toString());
}

SimpleName:IDENTIFIER 311 Visitor Visitor

SimpleName:IDENTIFIER 311 visitor visitor

SimpleName:IDENTIFIER 312 visitor visitor

SimpleName:IDENTIFIER 314 createActionPerformer createActionPerformer

@Test(expected = UnsupportedOperationException.class)
public void unsupportedActionType$simple() {
    new Action() {

        @Override
        public void formatTo(Formatter formatter, int flags, int width, int precision) {
            formatter.format(this.toString());
        }

        @Override
        public void accept(Visitor visitor) {
            visitor.visit(this);
        }
    }.accept(createActionPerformer());
}

package com.github.dakusui.actionunit.scenarios;

import com.github.dakusui.actionunit.core.Action;
import com.github.dakusui.actionunit.core.Context;
import com.github.dakusui.actionunit.core.context.ContextConsumer;
import com.github.dakusui.actionunit.exceptions.ActionException;
import com.github.dakusui.actionunit.io.Writer;
import com.github.dakusui.actionunit.visitors.ReportingActionPerformer;
import org.junit.Test;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Formatter;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import static com.github.dakusui.actionunit.core.ActionSupport.nop;
import static com.github.dakusui.actionunit.core.ActionSupport.parallel;
import static com.github.dakusui.actionunit.core.ActionSupport.retry;
import static com.github.dakusui.actionunit.core.ActionSupport.sequential;
import static com.github.dakusui.actionunit.core.ActionSupport.simple;
import static com.github.dakusui.actionunit.core.ActionSupport.timeout;
import static com.github.dakusui.actionunit.core.ActionSupport.when;
import static com.github.dakusui.actionunit.exceptions.ActionException.wrap;
import static com.github.dakusui.actionunit.ut.utils.TestUtils.createActionPerformer;
import static com.github.dakusui.actionunit.ut.utils.TestUtils.isRunByTravis;
import static com.github.dakusui.crest.Crest.asLong;
import static com.github.dakusui.crest.Crest.assertThat;
import static java.lang.System.currentTimeMillis;
import static java.util.Arrays.asList;
import static java.util.Collections.synchronizedList;
import static java.util.concurrent.TimeUnit.DAYS;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assume.assumeFalse;

public class adhoc_CompatActionSupportTest {

    private Map.Entry<Long, Long> createEntry() {
        long before = currentTimeMillis();
        try {
            TimeUnit.MILLISECONDS.sleep(1000);
            return new AbstractMap.SimpleEntry<>(before, currentTimeMillis());
        } catch (InterruptedException e) {
            throw wrap(e);
        }
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 317 expected expected

SimpleName:IDENTIFIER 317 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 318 unsupportedActionType$composite unsupportedActionType$composite

SimpleName:IDENTIFIER 321 formatTo formatTo

SimpleName:IDENTIFIER 321 Formatter Formatter

SimpleName:IDENTIFIER 321 formatter formatter

SimpleName:IDENTIFIER 321 precision precision

SimpleName:IDENTIFIER 322 formatter formatter

StringLiteralExpr:LITERAL 322 "dummy" "dummy"

{
    formatter.format("%s", "dummy");
}

SimpleName:IDENTIFIER 326 Visitor Visitor

SimpleName:IDENTIFIER 326 visitor visitor

SimpleName:IDENTIFIER 327 visitor visitor

SimpleName:IDENTIFIER 329 createActionPerformer createActionPerformer

@Test(expected = UnsupportedOperationException.class)
public void unsupportedActionType$composite() {
    new Action() {

        @Override
        public void formatTo(Formatter formatter, int flags, int width, int precision) {
            formatter.format("%s", "dummy");
        }

        @Override
        public void accept(Action.Visitor visitor) {
            visitor.visit(this);
        }
    }.accept(createActionPerformer());
}


SimpleName:IDENTIFIER 71 expected expected

SimpleName:IDENTIFIER 71 IllegalArgumentException IllegalArgumentException

@Test(expected = IllegalArgumentException.class)
public void givenNegativeStep$whenRangeIsInvoked$thenIllegalArgument() {
    range(0, 1, 0);
}

package com.github.dakusui.actionunit.ut;

import org.junit.Test;
import java.util.List;
import static com.github.dakusui.actionunit.ut.utils.TestUtils.range;
import static com.github.dakusui.actionunit.ut.utils.TestUtils.toList;
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertEquals;

public class adhoc_UtilsTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 27 expected expected

SimpleName:IDENTIFIER 27 ActionException ActionException

SimpleName:IDENTIFIER 29 ActionException ActionException

{
    throw ActionException.wrap(null);
}

@Test(expected = ActionException.class)
public void givenNull$whenWrap$thenActionExceptionIsThrown() {
    throw ActionException.wrap(null);
}

{
    throw ActionException.wrap(null);
}

package com.github.dakusui.actionunit.ut;

import com.github.dakusui.actionunit.exceptions.ActionException;
import org.junit.Test;

public class adhoc_ActionExceptionTest {

    public static class UnknownCheckedExceptionForTest extends Exception {

        UnknownCheckedExceptionForTest() {
        }
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 216 testAddingTagsWithNullNameThrowsAnError testAddingTagsWithNullNameThrowsAnError

SimpleName:IDENTIFIER 218 measurement measurement

StringLiteralExpr:LITERAL 218 "dontcare" "dontcare"

StringLiteralExpr:LITERAL 218 "DontCare" "DontCare"

@Test
public void testAddingTagsWithNullNameThrowsAnError() {
    Point.measurement("dontcare").tag(null, "DontCare");
}

@Test(expected = NullPointerException.class)
public void testAddingTagsWithNullNameThrowsAnError() {
    Point.measurement("dontcare").tag(null, "DontCare");
}

package org.influxdb.dto;

import org.influxdb.BuilderException;
import org.influxdb.InfluxDB;
import org.influxdb.InfluxDBMapperException;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;
import org.influxdb.annotation.TimeColumn;
import org.influxdb.impl.InfluxDBImpl;
import org.junit.Assert;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

@RunWith(JUnitPlatform.class)
public class adhoc_PointTest {

    static class PojoWithoutAnnotation {

        private String id;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }
    }

    @Measurement(name = "mymeasurement")
    static class PojoWithMeasurement {

        private String id;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }
    }

    @Measurement(name = "tcmeasurement")
    static class TimeColumnPojo {

        @Column(name = "booleanPrimitive")
        private boolean booleanPrimitive;

        @TimeColumn
        @Column(name = "time")
        private Instant time;
    }

    @Measurement(name = "tcmeasurement")
    static class TimeColumnPojoNano {

        @Column(name = "booleanPrimitive")
        private boolean booleanPrimitive;

        @TimeColumn(timeUnit = TimeUnit.NANOSECONDS)
        @Column(name = "time")
        private Instant time;
    }

    @Measurement(name = "tcmeasurement", allFields = true)
    static class TimeColumnPojoSec {

        boolean booleanPrimitive;

        @TimeColumn(timeUnit = TimeUnit.SECONDS)
        Instant time;
    }

    @Measurement(name = "tcmeasurement", allFields = true)
    static class BadTimeColumnPojo {

        boolean booleanPrimitive;

        @TimeColumn
        String time;
    }

    @Measurement(name = "mymeasurement")
    static class Pojo {

        @Column(name = "booleanPrimitive")
        private boolean booleanPrimitive;

        @Column(name = "time")
        @TimeColumn
        private Instant time;

        @Column(name = "uuid", tag = true)
        private String uuid;

        @Column(name = "doubleObject")
        private Double doubleObject;

        @Column(name = "longObject")
        private Long longObject;

        @Column(name = "integerObject")
        private Integer integerObject;

        @Column(name = "doublePrimitive")
        private double doublePrimitive;

        @Column(name = "longPrimitive")
        private long longPrimitive;

        @Column(name = "integerPrimitive")
        private int integerPrimitive;

        @Column(name = "booleanObject")
        private Boolean booleanObject;

        public Instant getTime() {
            return time;
        }

        public void setTime(Instant time) {
            this.time = time;
        }

        public String getUuid() {
            return uuid;
        }

        public void setUuid(String uuid) {
            this.uuid = uuid;
        }

        public Double getDoubleObject() {
            return doubleObject;
        }

        public void setDoubleObject(Double doubleObject) {
            this.doubleObject = doubleObject;
        }

        public Long getLongObject() {
            return longObject;
        }

        public void setLongObject(Long longObject) {
            this.longObject = longObject;
        }

        public Integer getIntegerObject() {
            return integerObject;
        }

        public void setIntegerObject(Integer integerObject) {
            this.integerObject = integerObject;
        }

        public double getDoublePrimitive() {
            return doublePrimitive;
        }

        public void setDoublePrimitive(double doublePrimitive) {
            this.doublePrimitive = doublePrimitive;
        }

        public long getLongPrimitive() {
            return longPrimitive;
        }

        public void setLongPrimitive(long longPrimitive) {
            this.longPrimitive = longPrimitive;
        }

        public int getIntegerPrimitive() {
            return integerPrimitive;
        }

        public void setIntegerPrimitive(int integerPrimitive) {
            this.integerPrimitive = integerPrimitive;
        }

        public Boolean getBooleanObject() {
            return booleanObject;
        }

        public void setBooleanObject(Boolean booleanObject) {
            this.booleanObject = booleanObject;
        }

        public boolean isBooleanPrimitive() {
            return booleanPrimitive;
        }

        public void setBooleanPrimitive(boolean booleanPrimitive) {
            this.booleanPrimitive = booleanPrimitive;
        }
    }

    @Measurement(name = "mymeasurement")
    static class PojoWithPublicAttributes {

        @Column(name = "booleanPrimitive")
        public boolean booleanPrimitive;

        @Column(name = "time")
        @TimeColumn
        public Instant time;

        @Column(name = "uuid", tag = true)
        public String uuid;

        @Column(name = "doubleObject")
        public Double doubleObject;

        @Column(name = "longObject")
        public Long longObject;

        @Column(name = "integerObject")
        public Integer integerObject;

        @Column(name = "doublePrimitive")
        public double doublePrimitive;

        @Column(name = "longPrimitive")
        public long longPrimitive;

        @Column(name = "integerPrimitive")
        public int integerPrimitive;

        @Column(name = "booleanObject")
        public Boolean booleanObject;
    }

    @Measurement(name = "mymeasurement", allFields = true)
    static class PojoWithAllFieldsAnnotation {

        public static final String staticField = "static";

        public boolean booleanPrimitive;

        @TimeColumn
        public Instant time;

        @Column(tag = true)
        public String uuid;

        public Double doubleObject;

        public Long longObject;

        public Integer integerObject;

        public double doublePrimitive;

        public long longPrimitive;

        public int integerPrimitive;

        public Boolean booleanObject;
    }

    @Measurement(name = "mymeasurement")
    static class PojoWithBlankColumnAnnotations {

        @Column
        public boolean booleanPrimitive;

        @Column
        @TimeColumn
        public Instant time;

        @Column(tag = true)
        public String uuid;

        @Column
        public Double doubleObject;

        @Column
        public Long longObject;

        @Column
        public Integer integerObject;

        @Column
        public double doublePrimitive;

        @Column
        public long longPrimitive;

        @Column
        public int integerPrimitive;

        @Column
        public Boolean booleanObject;
    }

    @Measurement(name = "SuperMeasuremet")
    static class SuperMeasurement {

        @Column(name = "superClassField")
        String superValue;
    }

    @Measurement(name = "SubMeasurement")
    static class SubClassMeasurement extends SuperMeasurement {

        @Column(name = "subClassField")
        String subValue;
    }

    @Measurement(name = "SuperMeasurement")
    static class MyGenericSuperMeasurement<T> {

        @Column(name = "superValue")
        protected T superValue;
    }

    @Measurement(name = "SubMeasurement")
    static class MyGenericSubMeasurement extends MyGenericSuperMeasurement<String> {

        @Column(name = "subValue")
        protected String subValue;
    }

    @Measurement(name = "PojoNumberPrimitiveTypes")
    static class PojoNumberPrimitiveTypes {

        @Column(name = "shortType")
        public short shortType;

        @Column(name = "intType")
        public int intType;

        @Column(name = "longType")
        public long longType;

        @Column(name = "floatType")
        public float floatType;

        @Column(name = "doubleType")
        public double doubleType;
    }
    /*TEST PLACEHOLDER*/
}

Tests for issue #110

SimpleName:IDENTIFIER 225 measurement measurement

StringLiteralExpr:LITERAL 225 "dontcare" "dontcare"

StringLiteralExpr:LITERAL 225 "DontCare" "DontCare"

@Test
public void testAddingTagsWithNullValueThrowsAnError() {
    Point.measurement("dontcare").tag("DontCare", null);
}

@Test(expected = NullPointerException.class)
public void testAddingTagsWithNullValueThrowsAnError() {
    Point.measurement("dontcare").tag("DontCare", null);
}


SimpleName:IDENTIFIER 248 testNullValueThrowsExceptionViaAddField testNullValueThrowsExceptionViaAddField

SimpleName:IDENTIFIER 250 measurement measurement

StringLiteralExpr:LITERAL 250 "dontcare" "dontcare"

SimpleName:IDENTIFIER 250 addField addField

StringLiteralExpr:LITERAL 250 "field" "field"

@Test
public void testNullValueThrowsExceptionViaAddField() {
    Point.measurement("dontcare").addField("field", (String) null);
}

@Test(expected = NullPointerException.class)
public void testNullValueThrowsExceptionViaAddField() {
    Point.measurement("dontcare").addField("field", (String) null);
}


SimpleName:IDENTIFIER 631 testAddFieldsFromPOJONullCheck testAddFieldsFromPOJONullCheck

SimpleName:IDENTIFIER 633 measurementByPOJO measurementByPOJO

@Test
public void testAddFieldsFromPOJONullCheck() {
    Point.measurementByPOJO(null);
}

@Test(expected = NullPointerException.class)
public void testAddFieldsFromPOJONullCheck() {
    Point.measurementByPOJO(null);
}


SimpleName:IDENTIFIER 84 testThrowExceptionIfMissingAnnotation testThrowExceptionIfMissingAnnotation

SimpleName:IDENTIFIER 86 throwExceptionIfMissingAnnotation throwExceptionIfMissingAnnotation

@Test
public void testThrowExceptionIfMissingAnnotation() {
    mapper.throwExceptionIfMissingAnnotation(String.class);
}

@Test(expected = IllegalArgumentException.class)
public void testThrowExceptionIfMissingAnnotation() {
    mapper.throwExceptionIfMissingAnnotation(String.class);
}

package org.influxdb.impl;

import org.influxdb.InfluxDBMapperException;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Exclude;
import org.influxdb.annotation.Measurement;
import org.influxdb.annotation.TimeColumn;
import org.influxdb.dto.QueryResult;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.runner.RunWith;
import java.time.Instant;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

@RunWith(JUnitPlatform.class)
public class adhoc_InfluxDBResultMapperTest {

    InfluxDBResultMapper mapper = new InfluxDBResultMapper();

    Double asDouble(Object obj) {
        return (Double) obj;
    }

    @Measurement(name = "HasTimeColumnMeasurement")
    static class HasTimeColumnMeasurement {

        @TimeColumn
        @Column(name = "time")
        private Instant time;

        @Column(name = "value")
        private Integer value;

        public Instant getTime() {
            return time;
        }

        public void setTime(Instant time) {
            this.time = time;
        }

        public Integer getValue() {
            return value;
        }

        public void setValue(Integer value) {
            this.value = value;
        }
    }

    @Measurement(name = "CustomMeasurement")
    static class MyCustomMeasurement {

        @Column(name = "time")
        private Instant time;

        @Column(name = "uuid")
        private String uuid;

        @Column(name = "doubleObject")
        private Double doubleObject;

        @Column(name = "longObject")
        private Long longObject;

        @Column(name = "integerObject")
        private Integer integerObject;

        @Column(name = "doublePrimitive")
        private double doublePrimitive;

        @Column(name = "longPrimitive")
        private long longPrimitive;

        @Column(name = "integerPrimitive")
        private int integerPrimitive;

        @Column(name = "booleanObject")
        private Boolean booleanObject;

        @Column(name = "booleanPrimitive")
        private boolean booleanPrimitive;

        @SuppressWarnings("unused")
        private String nonColumn1;

        @SuppressWarnings("unused")
        private Random rnd;

        @Override
        public String toString() {
            return "MyCustomMeasurement [time=" + time + ", uuid=" + uuid + ", doubleObject=" + doubleObject + ", longObject=" + longObject + ", integerObject=" + integerObject + ", doublePrimitive=" + doublePrimitive + ", longPrimitive=" + longPrimitive + ", integerPrimitive=" + integerPrimitive + ", booleanObject=" + booleanObject + ", booleanPrimitive=" + booleanPrimitive + "]";
        }
    }

    @Measurement(name = "CustomMeasurement", allFields = true)
    static class MyAllFieldsCustomMeasurement {

        private Instant time;

        private String uuid;

        private Double doubleObject;

        private Long longObject;

        private Integer integerObject;

        private double doublePrimitive;

        private long longPrimitive;

        private int integerPrimitive;

        private Boolean booleanObject;

        private boolean booleanPrimitive;

        @SuppressWarnings("unused")
        @Exclude
        private String nonColumn1;

        @SuppressWarnings("unused")
        @Exclude
        private Random rnd;

        @Override
        public String toString() {
            return "MyCustomMeasurement [time=" + time + ", uuid=" + uuid + ", doubleObject=" + doubleObject + ", longObject=" + longObject + ", integerObject=" + integerObject + ", doublePrimitive=" + doublePrimitive + ", longPrimitive=" + longPrimitive + ", integerPrimitive=" + integerPrimitive + ", booleanObject=" + booleanObject + ", booleanPrimitive=" + booleanPrimitive + "]";
        }
    }

    @Measurement(name = "SuperMeasurement")
    static class MySuperMeasurement {

        @Column(name = "superValue")
        protected String superValue;

        @Override
        public String toString() {
            return "SuperMeasurement [superValue=" + superValue + "]";
        }
    }

    @Measurement(name = "SubMeasurement")
    static class MySubMeasurement extends MySuperMeasurement {

        @Column(name = "subValue")
        protected String subValue;

        @Override
        public String toString() {
            return "MySubMeasurement [subValue=" + subValue + ", superValue=" + superValue + "]";
        }
    }

    @Measurement(name = "SuperMeasurement")
    static class MyGenericSuperMeasurement<T> {

        @Column(name = "superValue")
        protected T superValue;

        @Override
        public String toString() {
            return "SuperMeasurement [superValue=" + superValue + "]";
        }
    }

    @Measurement(name = "SubMeasurement")
    static class MyGenericSubMeasurement extends MyGenericSuperMeasurement<String> {

        @Column(name = "subValue")
        protected String subValue;

        @Override
        public String toString() {
            return "MySubMeasurement [subValue=" + subValue + ", superValue=" + superValue + "]";
        }
    }

    @Measurement(name = "foo")
    static class MyPojoWithUnsupportedField {

        @Column(name = "bar")
        private Date myDate;
    }

    @Measurement(name = "tb_network")
    static class GroupByCarrierDeviceOS {

        @Column(name = "time")
        private Instant time;

        @Column(name = "CARRIER", tag = true)
        private String carrier;

        @Column(name = "DEVICE_OS_VERSION", tag = true)
        private String deviceOsVersion;

        @Column(name = "median")
        private Double median;

        @Column(name = "min")
        private Double min;

        @Column(name = "max")
        private Double max;

        @Override
        public String toString() {
            return "GroupByCarrierDeviceOS [time=" + time + ", carrier=" + carrier + ", deviceOsVersion=" + deviceOsVersion + ", median=" + median + ", min=" + min + ", max=" + max + "]";
        }
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 17 expected expected

SimpleName:IDENTIFIER 17 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 18 testIntToShortOverflow testIntToShortOverflow

SimpleName:IDENTIFIER 19 SafeCast SafeCast

SimpleName:IDENTIFIER 19 safeIntToShort safeIntToShort

@Test(expected = IllegalStateException.class)
public void testIntToShortOverflow() {
    SafeCast.safeIntToShort(Short.MAX_VALUE + 1);
}

package edu.jhu.prim.util;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

public class adhoc_SafeCastTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 22 expected expected

SimpleName:IDENTIFIER 22 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 23 testIntToShortUnderflow testIntToShortUnderflow

SimpleName:IDENTIFIER 24 SafeCast SafeCast

SimpleName:IDENTIFIER 24 safeIntToShort safeIntToShort

@Test(expected = IllegalStateException.class)
public void testIntToShortUnderflow() {
    SafeCast.safeIntToShort(Short.MIN_VALUE - 1);
}


SimpleName:IDENTIFIER 35 expected expected

SimpleName:IDENTIFIER 35 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 36 testIntToByteOverflow testIntToByteOverflow

SimpleName:IDENTIFIER 37 SafeCast SafeCast

SimpleName:IDENTIFIER 37 safeIntToByte safeIntToByte

@Test(expected = IllegalStateException.class)
public void testIntToByteOverflow() {
    SafeCast.safeIntToByte(Byte.MAX_VALUE + 1);
}

SimpleName:IDENTIFIER 40 expected expected

SimpleName:IDENTIFIER 40 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 41 testIntToByteUnderflow testIntToByteUnderflow

SimpleName:IDENTIFIER 42 SafeCast SafeCast

SimpleName:IDENTIFIER 42 safeIntToByte safeIntToByte

@Test(expected = IllegalStateException.class)
public void testIntToByteUnderflow() {
    SafeCast.safeIntToByte(Byte.MIN_VALUE - 1);
}


SimpleName:IDENTIFIER 54 expected expected

SimpleName:IDENTIFIER 54 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 55 testIntToUnsignedShortOverflow testIntToUnsignedShortOverflow

SimpleName:IDENTIFIER 56 SafeCast SafeCast

SimpleName:IDENTIFIER 56 safeIntToUnsignedShort safeIntToUnsignedShort

@Test(expected = IllegalStateException.class)
public void testIntToUnsignedShortOverflow() {
    SafeCast.safeIntToUnsignedShort((int) (Math.pow(2, 16)));
}

SimpleName:IDENTIFIER 59 expected expected

SimpleName:IDENTIFIER 59 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 60 testIntToUnsignedShortUnderflow testIntToUnsignedShortUnderflow

SimpleName:IDENTIFIER 61 SafeCast SafeCast

SimpleName:IDENTIFIER 61 safeIntToUnsignedShort safeIntToUnsignedShort

@Test(expected = IllegalStateException.class)
public void testIntToUnsignedShortUnderflow() {
    SafeCast.safeIntToUnsignedShort(-1);
}


SimpleName:IDENTIFIER 73 expected expected

SimpleName:IDENTIFIER 73 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 74 testIntToUnsignedByteOverflow testIntToUnsignedByteOverflow

SimpleName:IDENTIFIER 75 SafeCast SafeCast

SimpleName:IDENTIFIER 75 safeIntToUnsignedByte safeIntToUnsignedByte

@Test(expected = IllegalStateException.class)
public void testIntToUnsignedByteOverflow() {
    SafeCast.safeIntToUnsignedByte((int) (Math.pow(2, 16)));
}

SimpleName:IDENTIFIER 78 expected expected

SimpleName:IDENTIFIER 78 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 79 testIntToUnsignedByteUnderflow testIntToUnsignedByteUnderflow

SimpleName:IDENTIFIER 80 SafeCast SafeCast

SimpleName:IDENTIFIER 80 safeIntToUnsignedByte safeIntToUnsignedByte

{
    SafeCast.safeIntToUnsignedByte(-1);
}

@Test(expected = IllegalStateException.class)
public void testIntToUnsignedByteUnderflow() {
    SafeCast.safeIntToUnsignedByte(-1);
}

{
    SafeCast.safeIntToUnsignedByte(-1);
}


SimpleName:IDENTIFIER 48 testClearGetSize testClearGetSize

SimpleName:IDENTIFIER 49 LongArrayList LongArrayList

SimpleName:IDENTIFIER 50 getLong getLong

SimpleName:IDENTIFIER 51 getLong getLong

SimpleName:IDENTIFIER 52 getLong getLong

@Test
public void testClearGetSize() {
    LongArrayList list = new LongArrayList();
    list.add(getLong(1));
    list.add(getLong(2));
    list.add(getLong(3));
    list.get(3);
}

@Test(expected = IndexOutOfBoundsException.class)
public void testClearGetSize() {
    LongArrayList list = new LongArrayList();
    list.add(getLong(1));
    list.add(getLong(2));
    list.add(getLong(3));
    list.get(3);
}

package edu.jhu.prim.list;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;

public class adhoc_LongArrayListTest {

    private int toInt(long d) {
        return (int) d;
    }

    private long[] getLongs(int... b) {
        long[] a = new long[b.length];
        for (int i = 0; i < b.length; i++) {
            a[i] = b[i];
        }
        return a;
    }

    private long getLong(int i) {
        return i;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 78 testSet testSet

SimpleName:IDENTIFIER 79 LongArrayList LongArrayList

SimpleName:IDENTIFIER 80 getLong getLong

SimpleName:IDENTIFIER 81 getLong getLong

SimpleName:IDENTIFIER 82 getLong getLong

@Test
public void testSet() {
    LongArrayList list = new LongArrayList();
    list.add(getLong(1));
    list.add(getLong(2));
    list.add(getLong(3));
    list.set(3, 0);
}

@Test(expected = IndexOutOfBoundsException.class)
public void testSet() {
    LongArrayList list = new LongArrayList();
    list.add(getLong(1));
    list.add(getLong(2));
    list.add(getLong(3));
    list.set(3, 0);
}


SimpleName:IDENTIFIER 49 DoubleArrayList DoubleArrayList

SimpleName:IDENTIFIER 50 getDouble getDouble

SimpleName:IDENTIFIER 51 getDouble getDouble

SimpleName:IDENTIFIER 52 getDouble getDouble

@Test
public void testClearGetSize() {
    DoubleArrayList list = new DoubleArrayList();
    list.add(getDouble(1));
    list.add(getDouble(2));
    list.add(getDouble(3));
    list.get(3);
}

@Test(expected = IndexOutOfBoundsException.class)
public void testClearGetSize() {
    DoubleArrayList list = new DoubleArrayList();
    list.add(getDouble(1));
    list.add(getDouble(2));
    list.add(getDouble(3));
    list.get(3);
}

package edu.jhu.prim.list;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;

public class adhoc_DoubleArrayListTest {

    private int toInt(double d) {
        return (int) d;
    }

    private double[] getDoubles(int... b) {
        double[] a = new double[b.length];
        for (int i = 0; i < b.length; i++) {
            a[i] = b[i];
        }
        return a;
    }

    private double getDouble(int i) {
        return i;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 79 DoubleArrayList DoubleArrayList

SimpleName:IDENTIFIER 80 getDouble getDouble

SimpleName:IDENTIFIER 81 getDouble getDouble

SimpleName:IDENTIFIER 82 getDouble getDouble

@Test
public void testSet() {
    DoubleArrayList list = new DoubleArrayList();
    list.add(getDouble(1));
    list.add(getDouble(2));
    list.add(getDouble(3));
    list.set(3, 0);
}

@Test(expected = IndexOutOfBoundsException.class)
public void testSet() {
    DoubleArrayList list = new DoubleArrayList();
    list.add(getDouble(1));
    list.add(getDouble(2));
    list.add(getDouble(3));
    list.set(3, 0);
}


SimpleName:IDENTIFIER 47 expected expected

SimpleName:IDENTIFIER 47 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 48 testBadFormat testBadFormat

SimpleName:IDENTIFIER 49 converter converter

SimpleName:IDENTIFIER 49 BooleanConverter BooleanConverter

SimpleName:IDENTIFIER 49 getSingleton getSingleton

SimpleName:IDENTIFIER 50 converter converter

SimpleName:IDENTIFIER 50 configure configure

@Test(expected = IllegalArgumentException.class)
public void testBadFormat() {
    BooleanConverter converter = BooleanConverter.getSingleton();
    converter.configure("1", 0, null);
}

package com.j256.simplecsv.converter;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.text.ParseException;
import org.junit.Test;
import com.j256.simplecsv.converter.BooleanConverter.ConfigInfo;
import com.j256.simplecsv.processor.ColumnInfo;
import com.j256.simplecsv.processor.ParseError;

public class adhoc_BooleanConverterTest extends AbstractConverterTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 53 expected expected

SimpleName:IDENTIFIER 53 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 54 testEmptyTrue testEmptyTrue

SimpleName:IDENTIFIER 55 converter converter

SimpleName:IDENTIFIER 55 BooleanConverter BooleanConverter

SimpleName:IDENTIFIER 55 getSingleton getSingleton

SimpleName:IDENTIFIER 56 converter converter

SimpleName:IDENTIFIER 56 configure configure

@Test(expected = IllegalArgumentException.class)
public void testEmptyTrue() {
    BooleanConverter converter = BooleanConverter.getSingleton();
    converter.configure(",F", 0, null);
}

SimpleName:IDENTIFIER 59 expected expected

SimpleName:IDENTIFIER 59 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 60 testEmptyFalse testEmptyFalse

SimpleName:IDENTIFIER 61 converter converter

SimpleName:IDENTIFIER 61 BooleanConverter BooleanConverter

SimpleName:IDENTIFIER 61 getSingleton getSingleton

SimpleName:IDENTIFIER 62 converter converter

SimpleName:IDENTIFIER 62 configure configure

@Test(expected = IllegalArgumentException.class)
public void testEmptyFalse() {
    BooleanConverter converter = BooleanConverter.getSingleton();
    converter.configure("T,", 0, null);
}


SimpleName:IDENTIFIER 7 expected expected

SimpleName:IDENTIFIER 7 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 8 testPrivateConstructor testPrivateConstructor

SimpleName:IDENTIFIER 9 ConverterUtils ConverterUtils

SimpleName:IDENTIFIER 9 constructConverter constructConverter

SimpleName:IDENTIFIER 9 PrivateConstructor PrivateConstructor

@Test(expected = IllegalArgumentException.class)
public void testPrivateConstructor() {
    ConverterUtils.constructConverter(PrivateConstructor.class);
}

package com.j256.simplecsv.converter;

import org.junit.Test;

public class adhoc_ConverterUtilsTest {

    private static class PrivateConstructor extends StringConverter {

        private PrivateConstructor() {
        }
    }

    private static class ConstructorThrows extends StringConverter {

        @SuppressWarnings("unused")
        public ConstructorThrows() {
            throw new RuntimeException("constructor throws");
        }
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 12 expected expected

SimpleName:IDENTIFIER 12 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 13 testConstructorThrows testConstructorThrows

SimpleName:IDENTIFIER 14 ConverterUtils ConverterUtils

SimpleName:IDENTIFIER 14 constructConverter constructConverter

SimpleName:IDENTIFIER 14 ConstructorThrows ConstructorThrows

@Test(expected = IllegalArgumentException.class)
public void testConstructorThrows() {
    ConverterUtils.constructConverter(ConstructorThrows.class);
}


SimpleName:IDENTIFIER 31 expected expected

SimpleName:IDENTIFIER 31 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 32 testInvalidPattern testInvalidPattern

SimpleName:IDENTIFIER 33 converter converter

SimpleName:IDENTIFIER 33 DateConverter DateConverter

SimpleName:IDENTIFIER 33 getSingleton getSingleton

SimpleName:IDENTIFIER 34 converter converter

SimpleName:IDENTIFIER 34 configure configure

StringLiteralExpr:LITERAL 34 "notagoodpattern" "notagoodpattern"

@Test(expected = IllegalArgumentException.class)
public void testInvalidPattern() {
    DateConverter converter = DateConverter.getSingleton();
    converter.configure("notagoodpattern", 0, null);
}

package com.j256.simplecsv.converter;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import org.junit.Test;

public class adhoc_DateConverterTest extends AbstractConverterTest {

    private Date makeDate(int year, int month, int day) {
        Calendar calender = Calendar.getInstance();
        calender.set(Calendar.YEAR, year);
        calender.set(Calendar.MONTH, month - 1);
        calender.set(Calendar.DAY_OF_MONTH, day);
        calender.set(Calendar.HOUR, 0);
        calender.set(Calendar.MINUTE, 0);
        calender.set(Calendar.SECOND, 0);
        calender.set(Calendar.MILLISECOND, 0);
        calender.set(Calendar.AM_PM, 0);
        return calender.getTime();
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 44 expected expected

SimpleName:IDENTIFIER 44 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 45 sendWithoutStarting sendWithoutStarting

SimpleName:IDENTIFIER 46 service service

SimpleName:IDENTIFIER 46 QueuedApnsService QueuedApnsService

SimpleName:IDENTIFIER 47 service service

SimpleName:IDENTIFIER 47 notification notification

@Test(expected = IllegalStateException.class)
public void sendWithoutStarting() {
    QueuedApnsService service = new QueuedApnsService(null);
    service.push(notification);
}

package com.notnoop.apns.internal;

import static org.junit.Assert.*;
import org.junit.Test;
import static org.mockito.Mockito.*;
import com.notnoop.apns.ApnsService;
import com.notnoop.apns.SimpleApnsNotification;
import com.notnoop.apns.internal.QueuedApnsServiceTest.ConnectionStub;

public class adhoc_QueuedApnsServiceTCTest {

    SimpleApnsNotification notification = new SimpleApnsNotification("2342", "{}");

    protected ApnsService newService(ApnsConnection connection, ApnsFeedbackConnection feedback) {
        ApnsService service = new ApnsServiceImpl(connection, null);
        ApnsService queued = new QueuedApnsService(service);
        queued.start();
        return queued;
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 48 expected expected

SimpleName:IDENTIFIER 48 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 49 sendWithoutStarting sendWithoutStarting

SimpleName:IDENTIFIER 50 service service

SimpleName:IDENTIFIER 50 QueuedApnsService QueuedApnsService

SimpleName:IDENTIFIER 51 service service

SimpleName:IDENTIFIER 51 notification notification

package com.notnoop.apns.internal;

import static org.junit.Assert.*;
import java.io.IOException;
import java.util.concurrent.Semaphore;
import org.junit.Test;
import static org.mockito.Mockito.*;
import com.notnoop.apns.ApnsNotification;
import com.notnoop.apns.ApnsService;
import com.notnoop.apns.EnhancedApnsNotification;
import com.notnoop.exceptions.NetworkIOException;

public class adhoc_QueuedApnsServiceTest {

    EnhancedApnsNotification notification = new EnhancedApnsNotification(1, EnhancedApnsNotification.MAXIMUM_EXPIRY, "2342", "{}");

    protected ApnsService newService(ApnsConnection connection, ApnsFeedbackConnection feedback) {
        ApnsService service = new ApnsServiceImpl(connection, null);
        ApnsService queued = new QueuedApnsService(service);
        queued.start();
        return queued;
    }

    static class ConnectionStub implements ApnsConnection {

        Semaphore semaphore;

        int delay;

        public ConnectionStub(int delay, int expectedCalls) {
            this.semaphore = new Semaphore(1 - expectedCalls);
            this.delay = delay;
        }

        volatile boolean stop;

        public synchronized void sendMessage(ApnsNotification m) {
            long time = System.currentTimeMillis();
            while (!stop && (System.currentTimeMillis() < time + delay)) {
                try {
                    Thread.sleep(2);
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                }
            }
            semaphore.release();
        }

        protected void interrupt() {
            stop = true;
        }

        public ApnsConnection copy() {
            throw new RuntimeException("Not implemented");
        }

        public void close() throws IOException {
        }

        public void testConnection() throws NetworkIOException {
        }

        public void setCacheLength(int cacheLength) {
        }

        public int getCacheLength() {
            return -1;
        }
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 65 invalidProxyParams invalidProxyParams

SimpleName:IDENTIFIER 65 IOException IOException

SimpleName:IDENTIFIER 67 TlsTunnelBuilder TlsTunnelBuilder

SimpleName:IDENTIFIER 67 makeTunnel makeTunnel

@Test
public void invalidProxyParams() throws IOException {
    new TlsTunnelBuilder().makeTunnel("origin.example.com", 9876, null, null, null);
}

@Test(expected = IOException.class)
public void invalidProxyParams() throws IOException {
    new TlsTunnelBuilder().makeTunnel("origin.example.com", 9876, null, null, null);
}

package com.notnoop.apns.internal;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;
import static org.junit.Assert.fail;

public class adhoc_TlsTunnelBuilderTest {

    private InputStream inputStream(String content) throws IOException {
        return new ByteArrayInputStream(content.getBytes("UTF-8"));
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 65 testRenameEntryClash testRenameEntryClash

SimpleName:IDENTIFIER 66 println println

StringLiteralExpr:LITERAL 66 "renameEntryClash" "renameEntryClash"

StringLiteralExpr:LITERAL
68
"An Entry for Testing"
"An Entry for Testing"

SimpleName:IDENTIFIER 70 addDirectory addDirectory

SimpleName:IDENTIFIER 71 addFile addFile

StringLiteralExpr:LITERAL
71
"A Name to change"
"A Name to change"

SimpleName:IDENTIFIER 74 setName setName

@Test
public void testRenameEntryClash() throws IOException {
    System.out.println("renameEntryClash");
    final String name = "An Entry for Testing";
    dir.addDirectory(name);
    final FatLfnDirectoryEntry f = dir.addFile("A Name to change");
    f.setName(name);
}

@Test(expected = IOException.class)
public void testRenameEntryClash() throws IOException {
    System.out.println("renameEntryClash");
    final String name = "An Entry for Testing";
    dir.addDirectory(name);
    final FatLfnDirectoryEntry f = dir.addFile("A Name to change");
    f.setName(name);
}

package de.waldheinz.fs.fat;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.HashSet;
import java.util.Locale;
import org.junit.Before;
import org.junit.Test;
import de.waldheinz.fs.BlockDevice;
import de.waldheinz.fs.FsDirectory;
import de.waldheinz.fs.FsDirectoryEntry;
import de.waldheinz.fs.FsFile;
import de.waldheinz.fs.util.RamDisk;

public class adhoc_FatLfnDirectoryTest {

    private BlockDevice dev;

    private BootSector bs;

    private Fat16RootDirectory rootDirStore;

    private Fat fat;

    private FatLfnDirectory dir;

    @Before
    public void setUp() throws IOException {
        this.dev = new RamDisk(1024 * 1024);
        SuperFloppyFormatter.get(dev).format().close();
        this.bs = BootSector.read(dev);
        this.rootDirStore = Fat16RootDirectory.read((Fat16BootSector) bs, false);
        this.fat = Fat.read(bs, 0);
        this.dir = new FatLfnDirectory(rootDirStore, fat, false);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 169 expected expected

SimpleName:IDENTIFIER 169 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 170 testSetChainLengthNegative testSetChainLengthNegative

SimpleName:IDENTIFIER 170 IOException IOException

SimpleName:IDENTIFIER 171 println println

StringLiteralExpr:LITERAL
171
"setChainLength (negative)"
"setChainLength (negative)"

SimpleName:IDENTIFIER 173 setChainLength setChainLength

@Test(expected = IllegalArgumentException.class)
public void testSetChainLengthNegative() throws IOException {
    System.out.println("setChainLength (negative)");
    cc.setChainLength(-1);
}

package de.waldheinz.fs.fat;

import de.waldheinz.fs.util.RamDisk;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_ClusterChainTest {

    private ClusterChain cc;

    private Fat fat;

    private BootSector bs;

    @Before
    public void setUp() throws IOException {
        final RamDisk rd = new RamDisk(512 * 2048);
        SuperFloppyFormatter.get(rd).format();
        bs = BootSector.read(rd);
        fat = Fat.read(bs, 0);
        cc = new ClusterChain(fat, false);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 60 expected expected

SimpleName:IDENTIFIER 60 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 61 testSetVolumeLabelTooLong testSetVolumeLabelTooLong

SimpleName:IDENTIFIER 62 println println

StringLiteralExpr:LITERAL
62
"setVolumeLabel (too long)"
"setVolumeLabel (too long)"

SimpleName:IDENTIFIER 64 setVolumeLabel setVolumeLabel

@Test(expected = IllegalArgumentException.class)
public void testSetVolumeLabelTooLong() {
    System.out.println("setVolumeLabel (too long)");
    bs.setVolumeLabel("012345678901");
}

package de.waldheinz.fs.fat;

import de.waldheinz.fs.BlockDevice;
import de.waldheinz.fs.util.RamDisk;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_Fat16BootSectorTest {

    private BlockDevice dev;

    private Fat16BootSector bs;

    @Before
    public void setUp() {
        this.dev = new RamDisk(1024);
        this.bs = new Fat16BootSector(dev);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 119 testGetFreeClusterCount testGetFreeClusterCount

SimpleName:IDENTIFIER 119 IOException IOException

SimpleName:IDENTIFIER 120 println println

StringLiteralExpr:LITERAL 120 "getFreeClusterCount" "getFreeClusterCount"

SimpleName:IDENTIFIER 122 getFreeClusterCount getFreeClusterCount

SimpleName:IDENTIFIER 125 assertEquals assertEquals

SimpleName:IDENTIFIER 125 getFreeClusterCount getFreeClusterCount

SimpleName:IDENTIFIER 126 allocNew allocNew

SimpleName:IDENTIFIER 129 assertEquals assertEquals

SimpleName:IDENTIFIER 129 getFreeClusterCount getFreeClusterCount

SimpleName:IDENTIFIER 132 allocNew allocNew

@Test
public void testGetFreeClusterCount() throws IOException {
    System.out.println("getFreeClusterCount");
    final int max = fat.getFreeClusterCount();
    for (int i = 0; i < max; i++) {
        assertEquals(max - i, fat.getFreeClusterCount());
        fat.allocNew();
    }
    assertEquals(0, fat.getFreeClusterCount());
    fat.allocNew();
}

@Test(expected = IOException.class)
public void testGetFreeClusterCount() throws IOException {
    System.out.println("getFreeClusterCount");
    final int max = fat.getFreeClusterCount();
    for (int i = 0; i < max; i++) {
        assertEquals(max - i, fat.getFreeClusterCount());
        fat.allocNew();
    }
    assertEquals(0, fat.getFreeClusterCount());
    fat.allocNew();
}

package de.waldheinz.fs.fat;

import de.waldheinz.fs.BlockDevice;
import de.waldheinz.fs.util.RamDisk;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_FatTest {

    private BlockDevice dev;

    private BootSector bs;

    private Fat fat;

    @Before
    public void setUp() throws IOException {
        this.dev = new RamDisk(1024 * 1024);
        this.bs = new Fat16BootSector(dev);
        this.bs.init();
        this.bs.setNrFats(2);
        this.bs.setBytesPerSector(dev.getSectorSize());
        this.bs.setSectorCount(dev.getSize() / dev.getSectorSize());
        this.bs.setSectorsPerCluster(1);
        this.bs.setSectorsPerFat(130);
        this.bs.write();
        this.fat = Fat.create(bs, 0);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 45 expected expected

SimpleName:IDENTIFIER 45 IOException IOException

SimpleName:IDENTIFIER 46 testCreateFail testCreateFail

SimpleName:IDENTIFIER 46 Exception Exception

SimpleName:IDENTIFIER 47 println println

StringLiteralExpr:LITERAL
47
"create (fail)"
"create (fail)"

SimpleName:IDENTIFIER 49 setFsInfoSectorNr setFsInfoSectorNr

SimpleName:IDENTIFIER 50 FsInfoSector FsInfoSector

@Test(expected = IOException.class)
public void testCreateFail() throws Exception {
    System.out.println("create (fail)");
    bs.setFsInfoSectorNr(0);
    FsInfoSector.create(bs);
}

package de.waldheinz.fs.fat;

import de.waldheinz.fs.BlockDevice;
import de.waldheinz.fs.util.RamDisk;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_FsInfoSectorTest {

    private BlockDevice dev;

    private Fat32BootSector bs;

    @Before
    public void setUp() throws IOException {
        this.dev = new RamDisk(1024);
        this.bs = new Fat32BootSector(dev);
        this.bs.init();
        this.bs.setFsInfoSectorNr(1);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 91 expected expected

SimpleName:IDENTIFIER 91 IOException IOException

SimpleName:IDENTIFIER 92 testReadTooLong testReadTooLong

SimpleName:IDENTIFIER 92 Exception Exception

SimpleName:IDENTIFIER 93 println println

StringLiteralExpr:LITERAL
93
"read (too long)"
"read (too long)"

SimpleName:IDENTIFIER 95 ByteBuffer ByteBuffer

SimpleName:IDENTIFIER 95 allocate allocate

SimpleName:IDENTIFIER 95 getLength getLength

@Test(expected = IOException.class)
public void testReadTooLong() throws Exception {
    System.out.println("read (too long)");
    final ByteBuffer data = ByteBuffer.allocate((int) ff.getLength() + 1);
    ff.read(0, data);
}

package de.waldheinz.fs.fat;

import de.waldheinz.fs.util.RamDisk;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_FatFileTest {

    private Fat fat;

    private FatLfnDirectoryEntry entry;

    private FatFile ff;

    @Before
    public void setUp() throws IOException {
        final InputStream is = getClass().getResourceAsStream("fat12-test.img.gz");
        final RamDisk rd = RamDisk.readGzipped(is);
        final FatFileSystem fatFs = new FatFileSystem(rd, false);
        this.entry = (FatLfnDirectoryEntry) fatFs.getRoot().getEntry("Readme.txt");
        this.fat = fatFs.getFat();
        this.ff = FatFile.get(fat, entry.realEntry);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 85 expected expected

SimpleName:IDENTIFIER 85 DirectoryFullException DirectoryFullException

SimpleName:IDENTIFIER 86 testCanChangeSizeBad testCanChangeSizeBad

SimpleName:IDENTIFIER 86 IOException IOException

SimpleName:IDENTIFIER 87 println println

StringLiteralExpr:LITERAL
87
"canChangeSize (bad)"
"canChangeSize (bad)"

SimpleName:IDENTIFIER 90 changeSize changeSize

SimpleName:IDENTIFIER 90 getCapacity getCapacity

@Test(expected = DirectoryFullException.class)
public void testCanChangeSizeBad() throws IOException {
    System.out.println("canChangeSize (bad)");
    Fat16RootDirectory dir = Fat16RootDirectory.create(bs);
    dir.changeSize(dir.getCapacity() + 1);
}

package de.waldheinz.fs.fat;

import de.waldheinz.fs.BlockDevice;
import de.waldheinz.fs.util.RamDisk;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_Fat16RootDirectoryTest {

    private BlockDevice dev;

    private Fat16BootSector bs;

    @Before
    public void setUp() throws IOException {
        this.dev = new RamDisk(1024 * 1024);
        this.bs = new Fat16BootSector(dev);
        this.bs.init();
        this.bs.setSectorsPerCluster(4);
        this.bs.write();
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 74 expected expected

SimpleName:IDENTIFIER 74 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 75 testSetSectorsPerClusterInvalid testSetSectorsPerClusterInvalid

SimpleName:IDENTIFIER 75 IOException IOException

SimpleName:IDENTIFIER 76 println println

StringLiteralExpr:LITERAL
76
"setSectorsPerCluster (invalid)"
"setSectorsPerCluster (invalid)"

SimpleName:IDENTIFIER 78 RamDisk RamDisk

SimpleName:IDENTIFIER 81 setSectorsPerCluster setSectorsPerCluster

@Test(expected = IllegalArgumentException.class)
public void testSetSectorsPerClusterInvalid() throws IOException {
    System.out.println("setSectorsPerCluster (invalid)");
    RamDisk rd = new RamDisk(512);
    BootSector bs = new Fat32BootSector(rd);
    bs.init();
    bs.setSectorsPerCluster(3);
}

package de.waldheinz.fs.fat;

import de.waldheinz.fs.util.RamDisk;
import java.io.IOException;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_BootSectorTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 114 expected expected

SimpleName:IDENTIFIER 114 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 115 IOException IOException

SimpleName:IDENTIFIER 116 println println

StringLiteralExpr:LITERAL
116
"fat16Format (too big)"
"fat16Format (too big)"

SimpleName:IDENTIFIER 117 createTempFile createTempFile

SimpleName:IDENTIFIER 120 FileDisk FileDisk

SimpleName:IDENTIFIER 121 SuperFloppyFormatter SuperFloppyFormatter

SimpleName:IDENTIFIER 121 setFatType setFatType

SimpleName:IDENTIFIER 121 FatType FatType

@Ignore
@Test(expected = IllegalArgumentException.class)
public void testFat16FormatTooBig() throws IOException {
    System.out.println("fat16Format (too big)");
    final File file = File.createTempFile("fat32-test", ".img");
    try {
        BlockDevice dev = FileDisk.create(file, 3 * 1024 * 1024 * 1024);
        SuperFloppyFormatter.get(dev).setFatType(FatType.FAT16);
    } finally {
        file.delete();
    }
}

package de.waldheinz.fs.fat;

import de.waldheinz.fs.BlockDevice;
import de.waldheinz.fs.util.FileDisk;
import de.waldheinz.fs.util.RamDisk;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SuperFloppyFormatterTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 54 expected expected

SimpleName:IDENTIFIER 54 ReadOnlyException ReadOnlyException

SimpleName:IDENTIFIER 55 testIsReadOnly testIsReadOnly

SimpleName:IDENTIFIER 55 IOException IOException

SimpleName:IDENTIFIER 56 println println

StringLiteralExpr:LITERAL 56 "isReadOnly" "isReadOnly"

SimpleName:IDENTIFIER 58 assertFalse assertFalse

SimpleName:IDENTIFIER 58 isReadOnly isReadOnly

SimpleName:IDENTIFIER 62 FileDisk FileDisk

SimpleName:IDENTIFIER 64 assertTrue assertTrue

SimpleName:IDENTIFIER 64 isReadOnly isReadOnly

SimpleName:IDENTIFIER 66 ByteBuffer ByteBuffer

SimpleName:IDENTIFIER 66 allocate allocate

@Test(expected = ReadOnlyException.class)
public void testIsReadOnly() throws IOException {
    System.out.println("isReadOnly");
    assertFalse(fd.isReadOnly());
    fd.close();
    fd = new FileDisk(f, true);
    assertTrue(fd.isReadOnly());
    fd.write(0, ByteBuffer.allocate(1000));
}

package de.waldheinz.fs.util;

import de.waldheinz.fs.ReadOnlyException;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Random;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_FileDiskTest {

    private final static int SIZE = 1024 * 1024;

    private FileDisk fd;

    private File f;

    @Before
    public void setUp() throws Exception {
        f = File.createTempFile("fileDiskTest", ".tmp");
        f.deleteOnExit();
        fd = FileDisk.create(f, SIZE);
    }

    @After
    public void tearDown() throws IOException {
        fd.close();
        f.delete();
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 84 expected expected

SimpleName:IDENTIFIER 84 IOException IOException

SimpleName:IDENTIFIER 85 testWritePastEnd testWritePastEnd

SimpleName:IDENTIFIER 85 IOException IOException

SimpleName:IDENTIFIER 86 println println

StringLiteralExpr:LITERAL 86 "writePastEnd" "writePastEnd"

SimpleName:IDENTIFIER 88 ByteBuffer ByteBuffer

SimpleName:IDENTIFIER 88 allocate allocate

@Test(expected = IOException.class)
public void testWritePastEnd() throws IOException {
    System.out.println("writePastEnd");
    fd.write(SIZE - 999, ByteBuffer.allocate(1000));
}


SimpleName:IDENTIFIER 77 expected expected

SimpleName:IDENTIFIER 77 IOException IOException

SimpleName:IDENTIFIER 78 testReadPastEnd testReadPastEnd

SimpleName:IDENTIFIER 78 IOException IOException

SimpleName:IDENTIFIER 79 println println

StringLiteralExpr:LITERAL 79 "readPastEnd" "readPastEnd"

SimpleName:IDENTIFIER 81 ByteBuffer ByteBuffer

SimpleName:IDENTIFIER 81 allocate allocate

@Test(expected = IOException.class)
public void testReadPastEnd() throws IOException {
    System.out.println("readPastEnd");
    fd.read(SIZE - 999, ByteBuffer.allocate(1000));
}


SimpleName:IDENTIFIER 31 expected expected

SimpleName:IDENTIFIER 31 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 32 rejectsEmptyIterable rejectsEmptyIterable

SimpleName:IDENTIFIER 32 Exception Exception

SimpleName:IDENTIFIER 33 SuccessiveTuples SuccessiveTuples

SimpleName:IDENTIFIER 33 forEach forEach

SimpleName:IDENTIFIER 34 Collections Collections

SimpleName:IDENTIFIER 34 emptyList emptyList

SimpleName:IDENTIFIER 35 println println

StringLiteralExpr:LITERAL 35 "nopping" "nopping"

@Test(expected = NoSuchElementException.class)
public void rejectsEmptyIterable() throws Exception {
    SuccessiveTuples.forEach(Collections.emptyList(), (a, b) -> System.out.println("nopping"));
}

package org.tenidwa.collections.utils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.NoSuchElementException;
import org.junit.Assert;
import org.junit.Test;

public final class adhoc_SuccessiveTuplesTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 39 expected expected

SimpleName:IDENTIFIER 39 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 40 rejectsSingleElementIterable rejectsSingleElementIterable

SimpleName:IDENTIFIER 40 Exception Exception

SimpleName:IDENTIFIER 41 SuccessiveTuples SuccessiveTuples

SimpleName:IDENTIFIER 41 forEach forEach

SimpleName:IDENTIFIER 42 Collections Collections

SimpleName:IDENTIFIER 42 singletonList singletonList

SimpleName:IDENTIFIER 43 println println

StringLiteralExpr:LITERAL 43 "nopping" "nopping"

@Test(expected = NoSuchElementException.class)
public void rejectsSingleElementIterable() throws Exception {
    SuccessiveTuples.forEach(Collections.singletonList(1), (a, b) -> System.out.println("nopping"));
}

SimpleName:IDENTIFIER 83 expected expected

SimpleName:IDENTIFIER 83 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 84 loopingOverEmptyIterableFails loopingOverEmptyIterableFails

SimpleName:IDENTIFIER 84 Exception Exception

SimpleName:IDENTIFIER 85 SuccessiveTuples SuccessiveTuples

SimpleName:IDENTIFIER 85 forEach forEach

SimpleName:IDENTIFIER 86 Collections Collections

SimpleName:IDENTIFIER 86 emptyList emptyList

SimpleName:IDENTIFIER 87 println println

StringLiteralExpr:LITERAL 87 "nopping" "nopping"

@Test(expected = NoSuchElementException.class)
public void loopingOverEmptyIterableFails() throws Exception {
    SuccessiveTuples.forEach(Collections.emptyList(), (a, b) -> System.out.println("nopping"));
}

SimpleName:IDENTIFIER 91 expected expected

SimpleName:IDENTIFIER 91 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 92 loopingOverSingleElementIterableFails loopingOverSingleElementIterableFails

SimpleName:IDENTIFIER 92 Exception Exception

SimpleName:IDENTIFIER 93 SuccessiveTuples SuccessiveTuples

SimpleName:IDENTIFIER 93 forEach forEach

SimpleName:IDENTIFIER 94 Collections Collections

SimpleName:IDENTIFIER 94 singletonList singletonList

StringLiteralExpr:LITERAL 94 "Anything" "Anything"

SimpleName:IDENTIFIER 95 println println

StringLiteralExpr:LITERAL 95 "nopping" "nopping"

@Test(expected = NoSuchElementException.class)
public void loopingOverSingleElementIterableFails() throws Exception {
    SuccessiveTuples.forEach(Collections.singletonList("Anything"), (a, b) -> System.out.println("nopping"));
}


SimpleName:IDENTIFIER 126 expected expected

SimpleName:IDENTIFIER 126 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 127 loopingOverEmptyTripletsIterableFails loopingOverEmptyTripletsIterableFails

SimpleName:IDENTIFIER 127 Exception Exception

SimpleName:IDENTIFIER 128 SuccessiveTuples SuccessiveTuples

SimpleName:IDENTIFIER 128 forEachLooped forEachLooped

SimpleName:IDENTIFIER 129 Collections Collections

SimpleName:IDENTIFIER 129 emptyList emptyList

SimpleName:IDENTIFIER 130 println println

StringLiteralExpr:LITERAL 130 "nopping" "nopping"

@Test(expected = NoSuchElementException.class)
public void loopingOverEmptyTripletsIterableFails() throws Exception {
    SuccessiveTuples.forEachLooped(Collections.emptyList(), (a, b, c) -> System.out.println("nopping"));
}

SimpleName:IDENTIFIER 134 expected expected

SimpleName:IDENTIFIER 134 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 136 Exception Exception

SimpleName:IDENTIFIER 137 SuccessiveTuples SuccessiveTuples

SimpleName:IDENTIFIER 137 forEachLooped forEachLooped

SimpleName:IDENTIFIER 138 Collections Collections

SimpleName:IDENTIFIER 138 singletonList singletonList

StringLiteralExpr:LITERAL 138 "Anything" "Anything"

SimpleName:IDENTIFIER 139 println println

StringLiteralExpr:LITERAL 139 "nopping" "nopping"

@Test(expected = NoSuchElementException.class)
public void loopingOverSingleElementTripletsIterableFails() throws Exception {
    SuccessiveTuples.forEachLooped(Collections.singletonList("Anything"), (a, b, c) -> System.out.println("nopping"));
}


SimpleName:IDENTIFIER 28 expected expected

SimpleName:IDENTIFIER 28 Exception Exception

SimpleName:IDENTIFIER 29 Exception Exception

SimpleName:IDENTIFIER 30 ZippedMap ZippedMap

SimpleName:IDENTIFIER 31 ImmutableList ImmutableList

StringLiteralExpr:LITERAL 31 "Fine" "Fine"

StringLiteralExpr:LITERAL 31 "Nice" "Nice"

SimpleName:IDENTIFIER 32 ImmutableList ImmutableList

@Test(expected = Exception.class)
public void failsToConstuctFromDifferentlySizedLists() throws Exception {
    new ZippedMap<>(ImmutableList.of("Ok", "Fine", "Nice"), ImmutableList.of(1, 2));
}

package org.tenidwa.collections.utils;

import com.google.common.collect.ImmutableList;
import org.junit.Assert;
import org.junit.Test;

public final class adhoc_ZippedMapTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 99 expected expected

SimpleName:IDENTIFIER 99 MalformedURLException MalformedURLException

SimpleName:IDENTIFIER 100 wrongProtocol wrongProtocol

SimpleName:IDENTIFIER 100 MalformedURLException MalformedURLException

SimpleName:IDENTIFIER 101 corruptedData corruptedData

SimpleName:IDENTIFIER 101 reddotTextData reddotTextData

SimpleName:IDENTIFIER 101 replace replace

StringLiteralExpr:LITERAL 101 "data:" "data:"

StringLiteralExpr:LITERAL 101 "blabla:" "blabla:"

SimpleName:IDENTIFIER 102 serializer serializer

SimpleName:IDENTIFIER 102 unserialize unserialize

SimpleName:IDENTIFIER 102 corruptedData corruptedData

@Test(expected = MalformedURLException.class)
public void wrongProtocol() throws MalformedURLException {
    String corruptedData = reddotTextData.replace("data:", "blabla:");
    serializer.unserialize(corruptedData);
}

package eu.maxschuster.dataurl;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.junit.Test;

public class adhoc_Base64EncodingTest {

    private final IDataUrlSerializer serializer = new DataUrlSerializer();

    private final byte[] reddotBinaryData;

    private final String reddotTextData;

    private final byte[] checkedBinaryData;

    private final String checkedTextData;

    public adhoc_Base64EncodingTest() throws IOException {
        this.reddotBinaryData = loadBinaryData("reddot.png");
        this.reddotTextData = loadTextData("reddot.txt");
        this.checkedBinaryData = loadBinaryData("checked.png");
        this.checkedTextData = loadTextData("checked.txt");
    }

    private byte[] loadBinaryData(String name) throws IOException {
        InputStream is = getClass().getResourceAsStream(name);
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        byte[] data = new byte[1024];
        int r;
        while ((r = is.read(data)) > 0) {
            os.write(data, 0, r);
        }
        return os.toByteArray();
    }

    private String loadTextData(String name) throws IOException {
        byte[] data = loadBinaryData(name);
        return new String(data, "UTF-8");
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 105 expected expected

SimpleName:IDENTIFIER 105 MalformedURLException MalformedURLException

SimpleName:IDENTIFIER 106 wrongEncoding wrongEncoding

SimpleName:IDENTIFIER 106 MalformedURLException MalformedURLException

SimpleName:IDENTIFIER 107 corruptedData corruptedData

SimpleName:IDENTIFIER 107 reddotTextData reddotTextData

SimpleName:IDENTIFIER 107 replace replace

SimpleName:IDENTIFIER 108 serializer serializer

SimpleName:IDENTIFIER 108 unserialize unserialize

SimpleName:IDENTIFIER 108 corruptedData corruptedData

@Test(expected = MalformedURLException.class)
public void wrongEncoding() throws MalformedURLException {
    String corruptedData = reddotTextData.replace(";base64,", ";phase10,");
    serializer.unserialize(corruptedData);
}


SimpleName:IDENTIFIER 43 testAttachFileLongFileString testAttachFileLongFileString

SimpleName:IDENTIFIER 45 discussionAttachmentResources discussionAttachmentResources

SimpleName:IDENTIFIER 45 attachFile attachFile

StringLiteralExpr:LITERAL 45 "application/pdf" "application/pdf"

@Test
public void testAttachFileLongFileString() {
    discussionAttachmentResources.attachFile(1234L, new File("src/test/rescoures/getPDF.pdf"), "application/pdf");
}

@Test(expected = UnsupportedOperationException.class)
public void testAttachFileLongFileString() {
    discussionAttachmentResources.attachFile(1234L, new File("src/test/rescoures/getPDF.pdf"), "application/pdf");
}

package com.smartsheet.api.internal;

import com.smartsheet.api.internal.http.DefaultHttpClient;
import org.junit.Before;
import org.junit.Test;
import java.io.ByteArrayInputStream;
import java.io.File;
import static org.junit.Assert.fail;

public class adhoc_DiscussionAttachmentResourcesTest extends ResourcesImplBase {

    private DiscussionAttachmentResources discussionAttachmentResources;

    @Before
    public void setUp() throws Exception {
        discussionAttachmentResources = new DiscussionAttachmentResources(new SmartsheetImpl("http://localhost:9090/1.1/", "accessToken", new DefaultHttpClient(), serializer));
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 53 testAttachFileLongFileStringLong testAttachFileLongFileStringLong

SimpleName:IDENTIFIER 55 discussionAttachmentResources discussionAttachmentResources

SimpleName:IDENTIFIER 55 attachFile attachFile

SimpleName:IDENTIFIER 55 ByteArrayInputStream ByteArrayInputStream

StringLiteralExpr:LITERAL 55 "application/pdf" "application/pdf"

@Test
public void testAttachFileLongFileStringLong() {
    discussionAttachmentResources.attachFile(1234L, new ByteArrayInputStream(new byte[] {}), "application/pdf", 1234L, "file.pdf");
}

@Test(expected = UnsupportedOperationException.class)
public void testAttachFileLongFileStringLong() {
    discussionAttachmentResources.attachFile(1234L, new ByteArrayInputStream(new byte[] {}), "application/pdf", 1234L, "file.pdf");
}


SimpleName:IDENTIFIER 53 testSerialize testSerialize

SimpleName:IDENTIFIER 57 serialize serialize

SimpleName:IDENTIFIER 57 ByteArrayOutputStream ByteArrayOutputStream

StringLiteralExpr:LITERAL
58
"should throw exception"
"should throw exception"

SimpleName:IDENTIFIER 59 IllegalArgumentException IllegalArgumentException

 catch (IllegalArgumentException ex) {
}

SimpleName:IDENTIFIER 65 serialize serialize

StringLiteralExpr:LITERAL
66
"should throw exception"
"should throw exception"

SimpleName:IDENTIFIER 67 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 73 serialize serialize

StringLiteralExpr:LITERAL
74
"should throw exception"
"should throw exception"

SimpleName:IDENTIFIER 75 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 80 JSONSerializerException JSONSerializerException

SimpleName:IDENTIFIER 86 serialize serialize

SimpleName:IDENTIFIER 86 ByteArrayOutputStream ByteArrayOutputStream

"The id field should not be serialized. Instead the id is used in the url and not sent as part of the body."

@Test
public void testSerialize() {
    try {
        try {
            jjs.serialize(null, new ByteArrayOutputStream());
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
        }
        try {
            jjs.serialize(new Object(), null);
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
        }
        try {
            jjs.serialize(null, null);
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
        }
    } catch (JSONSerializerException ex) {
        fail("Shouldn't have thrown this exception: " + ex);
    }
    jjs.serialize(new Object(), new ByteArrayOutputStream());
}

@Test(expected = JSONSerializerException.class)
public void testSerialize() {
    try {
        try {
            jjs.serialize(null, new ByteArrayOutputStream());
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
        }
        try {
            jjs.serialize(new Object(), null);
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
        }
        try {
            jjs.serialize(null, null);
            fail("should throw exception");
        } catch (IllegalArgumentException ex) {
        }
    } catch (JSONSerializerException ex) {
        fail("Shouldn't have thrown this exception: " + ex);
    }
    jjs.serialize(new Object(), new ByteArrayOutputStream());
}

package com.smartsheet.api.internal.json;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.smartsheet.api.models.Folder;
import com.smartsheet.api.models.Result;
import com.smartsheet.api.models.User;
import org.junit.Before;
import org.junit.Test;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.*;

public class adhoc_JacksonJsonSerializerTest {

    JacksonJsonSerializer jjs;

    @Before
    public void setUp() throws Exception {
        jjs = new JacksonJsonSerializer();
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 290 testDeserializeResult testDeserializeResult

SimpleName:IDENTIFIER 293 deserializeResult deserializeResult

StringLiteralExpr:LITERAL
294
"Exception should have been thrown."
"Exception should have been thrown."

fail("Exception should have been thrown.")

fail("Exception should have been thrown.");

SimpleName:IDENTIFIER 295 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 300 deserializeResult deserializeResult

StringLiteralExpr:LITERAL
301
"Exception should have been thrown."
"Exception should have been thrown."

SimpleName:IDENTIFIER 302 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 307 deserializeResult deserializeResult

SimpleName:IDENTIFIER 307 ByteArrayInputStream ByteArrayInputStream

StringLiteralExpr:LITERAL
308
"Exception should have been thrown."
"Exception should have been thrown."

SimpleName:IDENTIFIER 309 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 312 Exception Exception

StringLiteralExpr:LITERAL
313
"Exception should not be thrown: "
"Exception should not be thrown: "

Result<Folder> result = new Result<Folder>()

SimpleName:IDENTIFIER 317 setMessage setMessage

StringLiteralExpr:LITERAL
317
"Test Result"
"Test Result"

SimpleName:IDENTIFIER 318 outputStream outputStream

SimpleName:IDENTIFIER 318 ByteArrayOutputStream ByteArrayOutputStream

outputStream = new ByteArrayOutputStream()

SimpleName:IDENTIFIER 322 serialize serialize

SimpleName:IDENTIFIER 322 outputStream outputStream

SimpleName:IDENTIFIER 323 deserializeResult deserializeResult

SimpleName:IDENTIFIER 323 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 323 outputStream outputStream

SimpleName:IDENTIFIER 323 toByteArray toByteArray

SimpleName:IDENTIFIER 324 JSONSerializerException JSONSerializerException

StringLiteralExpr:LITERAL
325
"Exception should not be thrown: "
"Exception should not be thrown: "

SimpleName:IDENTIFIER 330 outputStream outputStream

SimpleName:IDENTIFIER 330 ByteArrayOutputStream ByteArrayOutputStream

outputStream = new ByteArrayOutputStream()

outputStream = new ByteArrayOutputStream();

SimpleName:IDENTIFIER 331 ArrayList ArrayList

SimpleName:IDENTIFIER 332 serialize serialize

SimpleName:IDENTIFIER 332 outputStream outputStream

SimpleName:IDENTIFIER 333 deserializeResult deserializeResult

SimpleName:IDENTIFIER 333 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 333 outputStream outputStream

SimpleName:IDENTIFIER 333 toByteArray toByteArray

"Issue running a test where a temp file is being created."

"Should have thrown a JsonParseException"

@Test
public void testDeserializeResult() {
    try {
        try {
            jjs.deserializeResult(null, null);
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
        try {
            jjs.deserializeResult(User.class, null);
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
        try {
            jjs.deserializeResult(null, new ByteArrayInputStream(new byte[10]));
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
    } catch (Exception ex) {
        fail("Exception should not be thrown: " + ex);
    }
    Result<Folder> result = new Result<Folder>();
    result.setMessage("Test Result");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    try {
        jjs.serialize(result, outputStream);
        jjs.deserializeResult(Result.class, new ByteArrayInputStream(outputStream.toByteArray()));
    } catch (JSONSerializerException ex) {
        fail("Exception should not be thrown: " + ex);
    }
    outputStream = new ByteArrayOutputStream();
    ArrayList<User> users = new ArrayList<User>();
    jjs.serialize(users, outputStream);
    jjs.deserializeResult(Result.class, new ByteArrayInputStream(outputStream.toByteArray()));
}

@Test(expected = JSONSerializerException.class)
public void testDeserializeResult() {
    try {
        try {
            jjs.deserializeResult(null, null);
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
        try {
            jjs.deserializeResult(User.class, null);
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
        try {
            jjs.deserializeResult(null, new ByteArrayInputStream(new byte[10]));
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
    } catch (Exception ex) {
        fail("Exception should not be thrown: " + ex);
    }
    Result<Folder> result = new Result<Folder>();
    result.setMessage("Test Result");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    try {
        jjs.serialize(result, outputStream);
        jjs.deserializeResult(Result.class, new ByteArrayInputStream(outputStream.toByteArray()));
    } catch (JSONSerializerException ex) {
        fail("Exception should not be thrown: " + ex);
    }
    outputStream = new ByteArrayOutputStream();
    ArrayList<User> users = new ArrayList<User>();
    jjs.serialize(users, outputStream);
    jjs.deserializeResult(Result.class, new ByteArrayInputStream(outputStream.toByteArray()));
}


SimpleName:IDENTIFIER 365 testDeserializeListResult testDeserializeListResult

SimpleName:IDENTIFIER 368 deserializeListResult deserializeListResult

StringLiteralExpr:LITERAL
369
"Exception should have been thrown."
"Exception should have been thrown."

fail("Exception should have been thrown.")

fail("Exception should have been thrown.");

SimpleName:IDENTIFIER 370 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 375 deserializeListResult deserializeListResult

StringLiteralExpr:LITERAL
376
"Exception should have been thrown."
"Exception should have been thrown."

SimpleName:IDENTIFIER 377 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 382 deserializeListResult deserializeListResult

SimpleName:IDENTIFIER 382 ByteArrayInputStream ByteArrayInputStream

StringLiteralExpr:LITERAL
383
"Exception should have been thrown."
"Exception should have been thrown."

SimpleName:IDENTIFIER 384 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 387 Exception Exception

StringLiteralExpr:LITERAL
388
"Exception should not be thrown: "
"Exception should not be thrown: "

SimpleName:IDENTIFIER 391 ArrayList ArrayList

result = new Result<ArrayList<Object>>()

SimpleName:IDENTIFIER 392 setMessage setMessage

StringLiteralExpr:LITERAL
392
"Test Message"
"Test Message"

SimpleName:IDENTIFIER 393 outputStream outputStream

SimpleName:IDENTIFIER 393 ByteArrayOutputStream ByteArrayOutputStream

outputStream = new ByteArrayOutputStream()

SimpleName:IDENTIFIER 397 serialize serialize

SimpleName:IDENTIFIER 397 outputStream outputStream

SimpleName:IDENTIFIER 398 deserializeListResult deserializeListResult

SimpleName:IDENTIFIER 398 ByteArrayInputStream ByteArrayInputStream

SimpleName:IDENTIFIER 398 outputStream outputStream

SimpleName:IDENTIFIER 398 toByteArray toByteArray

SimpleName:IDENTIFIER 399 JSONSerializerException JSONSerializerException

StringLiteralExpr:LITERAL
400
"Exception should not be thrown: "
"Exception should not be thrown: "

fail("Exception should not be thrown: " + ex)

SimpleName:IDENTIFIER 407 FileInputStream FileInputStream

SimpleName:IDENTIFIER 407 createTempFile createTempFile

SimpleName:IDENTIFIER 409 Exception Exception

SimpleName:IDENTIFIER 413 deserializeListResult deserializeListResult

"Should have thrown a JsonParseException"

@Test
public void testDeserializeListResult() {
    try {
        try {
            jjs.deserializeListResult(null, null);
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
        try {
            jjs.deserializeListResult(User.class, null);
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
        try {
            jjs.deserializeListResult(null, new ByteArrayInputStream(new byte[10]));
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
    } catch (Exception ex) {
        fail("Exception should not be thrown: " + ex);
    }
    Result<ArrayList<Object>> result = new Result<ArrayList<Object>>();
    result.setMessage("Test Message");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    try {
        jjs.serialize(result, outputStream);
        jjs.deserializeListResult(Result.class, new ByteArrayInputStream(outputStream.toByteArray()));
    } catch (JSONSerializerException ex) {
        fail("Exception should not be thrown: " + ex);
    }
    FileInputStream fis = null;
    try {
        fis = new FileInputStream(File.createTempFile("json_test", ".tmp"));
        fis.close();
    } catch (Exception ex) {
        fail("Issue running a test where a temp file is being created." + ex);
    }
    jjs.deserializeListResult(Result.class, fis);
}

@Test(expected = JSONSerializerException.class)
public void testDeserializeListResult() {
    try {
        try {
            jjs.deserializeListResult(null, null);
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
        try {
            jjs.deserializeListResult(User.class, null);
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
        try {
            jjs.deserializeListResult(null, new ByteArrayInputStream(new byte[10]));
            fail("Exception should have been thrown.");
        } catch (IllegalArgumentException e) {
        }
    } catch (Exception ex) {
        fail("Exception should not be thrown: " + ex);
    }
    Result<ArrayList<Object>> result = new Result<ArrayList<Object>>();
    result.setMessage("Test Message");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    try {
        jjs.serialize(result, outputStream);
        jjs.deserializeListResult(Result.class, new ByteArrayInputStream(outputStream.toByteArray()));
    } catch (JSONSerializerException ex) {
        fail("Exception should not be thrown: " + ex);
    }
    FileInputStream fis = null;
    try {
        fis = new FileInputStream(File.createTempFile("json_test", ".tmp"));
        fis.close();
    } catch (Exception ex) {
        fail("Issue running a test where a temp file is being created." + ex);
    }
    jjs.deserializeListResult(Result.class, fis);
}


SimpleName:IDENTIFIER 215 testRevokeAccessToken testRevokeAccessToken

SimpleName:IDENTIFIER 215 InvalidRequestException InvalidRequestException

SimpleName:IDENTIFIER 215 NoSuchAlgorithmException NoSuchAlgorithmException

SimpleName:IDENTIFIER 216 UnsupportedEncodingException UnsupportedEncodingException

SimpleName:IDENTIFIER 216 OAuthTokenException OAuthTokenException

SimpleName:IDENTIFIER 216 JSONSerializerException JSONSerializerException

SimpleName:IDENTIFIER 216 HttpClientException HttpClientException

SimpleName:IDENTIFIER 217 URISyntaxException URISyntaxException

SimpleName:IDENTIFIER 218 setTokenURL setTokenURL

SimpleName:IDENTIFIER 221 setAccessToken setAccessToken

StringLiteralExpr:LITERAL 221 "AccessToken" "AccessToken"

SimpleName:IDENTIFIER 222 setExpiresInSeconds setExpiresInSeconds

SimpleName:IDENTIFIER 223 setRefreshToken setRefreshToken

StringLiteralExpr:LITERAL 223 "refreshToken" "refreshToken"

SimpleName:IDENTIFIER 224 setTokenType setTokenType

StringLiteralExpr:LITERAL 224 "tokenType" "tokenType"

SimpleName:IDENTIFIER 226 revokeAccessToken revokeAccessToken

@Test
public void testRevokeAccessToken() throws InvalidRequestException, NoSuchAlgorithmException, UnsupportedEncodingException, OAuthTokenException, JSONSerializerException, HttpClientException, URISyntaxException {
    oauth.setTokenURL("https://api.smartsheet.com/1.1/token");
    Token token = new Token();
    token.setAccessToken("AccessToken");
    token.setExpiresInSeconds(10L);
    token.setRefreshToken("refreshToken");
    token.setTokenType("tokenType");
    oauth.revokeAccessToken(token);
}

@Test(expected = OAuthTokenException.class)
public void testRevokeAccessToken() throws InvalidRequestException, NoSuchAlgorithmException, UnsupportedEncodingException, OAuthTokenException, JSONSerializerException, HttpClientException, URISyntaxException {
    oauth.setTokenURL("https://api.smartsheet.com/1.1/token");
    Token token = new Token();
    token.setAccessToken("AccessToken");
    token.setExpiresInSeconds(10L);
    token.setRefreshToken("refreshToken");
    token.setTokenType("tokenType");
    oauth.revokeAccessToken(token);
}

package com.smartsheet.api.internal.oauth;

import com.smartsheet.api.HttpTestServer;
import com.smartsheet.api.InvalidRequestException;
import com.smartsheet.api.internal.http.DefaultHttpClient;
import com.smartsheet.api.internal.http.HttpClient;
import com.smartsheet.api.internal.http.HttpClientException;
import com.smartsheet.api.internal.json.JSONSerializerException;
import com.smartsheet.api.internal.json.JacksonJsonSerializer;
import com.smartsheet.api.internal.json.JsonSerializer;
import com.smartsheet.api.oauth.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.security.NoSuchAlgorithmException;
import java.util.EnumSet;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

public class adhoc_OAuthFlowImplTest {

    OAuthFlowImpl oauth;

    String clientId = "clientID";

    String clientSecret = "clientSecret";

    String redirectURL = "redirectURL";

    String authorizationURL = "authorizationURL";

    String tokenURL = "tokenURL";

    HttpClient httpClient = new DefaultHttpClient();

    JsonSerializer json = new JacksonJsonSerializer();

    HttpTestServer server;

    @After
    public void baseTearDown() throws Exception {
        server.stop();
    }

    @Before
    public void setUp() throws Exception {
        oauth = new OAuthFlowImpl(clientId, clientSecret, redirectURL, authorizationURL, tokenURL, httpClient, json);
        server = new HttpTestServer();
        server.setPort(9090);
        server.start();
        JacksonJsonSerializer serializer = new JacksonJsonSerializer();
        serializer.setFailOnUnknownProperties(true);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 45 expected expected

SimpleName:IDENTIFIER 45 IllegalArgumentException IllegalArgumentException

@Test(expected = IllegalArgumentException.class)
public void save() {
    post.save();
}

package com.tumblr.jumblr.types;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.tumblr.jumblr.responses.PostDeserializer;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

public class adhoc_AnswerPostTest extends TypeTest {

    private AnswerPost post;

    private String askingUrl = "asking_url";

    private String askingName = "asking_name";

    private String question = "question";

    private String answer = "answer";

    @Before
    public void setup() {
        Map<String, String> flat = new HashMap<String, String>();
        flat.put("type", "answer");
        flat.put("asking_url", askingUrl);
        flat.put("asking_name", askingName);
        flat.put("question", question);
        flat.put("answer", answer);
        Gson gson = new GsonBuilder().registerTypeAdapter(Post.class, new PostDeserializer()).create();
        post = (AnswerPost) gson.fromJson(flatSerialize(flat), Post.class);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 54 expected expected

SimpleName:IDENTIFIER 54 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 55 setDataWithEmbedCode setDataWithEmbedCode

SimpleName:IDENTIFIER 56 setData setData

SimpleName:IDENTIFIER 57 setEmbedCode setEmbedCode

StringLiteralExpr:LITERAL 57 "something" "something"

@Test(expected = IllegalArgumentException.class)
public void setDataWithEmbedCode() {
    post.setData(new File("some_path"));
    post.setEmbedCode("something");
}

package com.tumblr.jumblr.types;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.tumblr.jumblr.responses.PostDeserializer;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

public class adhoc_VideoPostTest extends TypeTest {

    private int thumbnailHeight = 2;

    private int thumbnailWidth = 2;

    private String permalinkUrl = "permaUrl";

    private String thumbnailUrl = "url";

    private String caption = "hello";

    private String videos = "[{\"width\":300,\"embed_code\":\"embed\"}]";

    private VideoPost post;

    @Before
    public void setup() {
        Map<String, Object> flat = new HashMap<String, Object>();
        flat.put("type", "video");
        flat.put("caption", caption);
        flat.put("player", videos);
        flat.put("thumbnail_url", thumbnailUrl);
        flat.put("thumbnail_width", thumbnailWidth);
        flat.put("thumbnail_height", thumbnailHeight);
        flat.put("permalink_url", permalinkUrl);
        Gson gson = new GsonBuilder().registerTypeAdapter(Post.class, new PostDeserializer()).create();
        post = (VideoPost) gson.fromJson(flatSerialize(flat), Post.class);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 70 expected expected

SimpleName:IDENTIFIER 70 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 71 setEmbedCodeWithData setEmbedCodeWithData

SimpleName:IDENTIFIER 72 setEmbedCode setEmbedCode

StringLiteralExpr:LITERAL 72 "something" "something"

SimpleName:IDENTIFIER 73 setData setData

@Test(expected = IllegalArgumentException.class)
public void setEmbedCodeWithData() {
    post.setEmbedCode("something");
    post.setData(new File("some_path"));
}


SimpleName:IDENTIFIER 60 expected expected

SimpleName:IDENTIFIER 60 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 61 setDataWithSource setDataWithSource

SimpleName:IDENTIFIER 62 setData setData

SimpleName:IDENTIFIER 63 setExternalUrl setExternalUrl

StringLiteralExpr:LITERAL 63 "something" "something"

@Test(expected = IllegalArgumentException.class)
public void setDataWithSource() {
    post.setData(new File("some_path"));
    post.setExternalUrl("something");
}

package com.tumblr.jumblr.types;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.tumblr.jumblr.responses.PostDeserializer;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

public class adhoc_AudioPostTest extends TypeTest {

    private String caption = "hello";

    private String trackName = "basketcase", albumName = "dookie";

    private String artistName = "green day", albumArtUrl = "http://google.com";

    private Integer plays = 24, year = 1997, trackNumber = 2;

    private String embedCode = "is";

    private String audioUrl = "audioUrl";

    private AudioPost post;

    @Before
    public void setup() {
        Map<String, Object> flat = new HashMap<String, Object>();
        flat.put("type", "audio");
        flat.put("plays", plays);
        flat.put("caption", caption);
        flat.put("track_name", trackName);
        flat.put("album", albumName);
        flat.put("artist", artistName);
        flat.put("album_art", albumArtUrl);
        flat.put("year", year);
        flat.put("track_number", trackNumber);
        flat.put("player", embedCode);
        flat.put("audio_url", audioUrl);
        Gson gson = new GsonBuilder().registerTypeAdapter(Post.class, new PostDeserializer()).create();
        post = (AudioPost) gson.fromJson(flatSerialize(flat), Post.class);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 76 expected expected

SimpleName:IDENTIFIER 76 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 77 setSourceWithData setSourceWithData

SimpleName:IDENTIFIER 78 setExternalUrl setExternalUrl

StringLiteralExpr:LITERAL 78 "something" "something"

SimpleName:IDENTIFIER 79 setData setData

@Test(expected = IllegalArgumentException.class)
public void setSourceWithData() {
    post.setExternalUrl("something");
    post.setData(new File("some_path"));
}


SimpleName:IDENTIFIER 32 testClearEmptyJson testClearEmptyJson

@Test
public void testClearEmptyJson() {
    Response r = mock(Response.class);
    when(r.getCode()).thenReturn(200);
    when(r.getBody()).thenReturn("");
    ResponseWrapper got = rb.clear(r);
}

@Test(expected = JumblrException.class)
public void testClearEmptyJson() {
    Response r = mock(Response.class);
    when(r.getCode()).thenReturn(200);
    when(r.getBody()).thenReturn("");
    ResponseWrapper got = rb.clear(r);
}

package com.tumblr.jumblr.request;

import com.tumblr.jumblr.JumblrClient;
import com.tumblr.jumblr.exceptions.JumblrException;
import com.tumblr.jumblr.responses.ResponseWrapper;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.scribe.model.OAuthRequest;
import org.scribe.model.Response;
import org.scribe.model.Token;

public class adhoc_RequestBuilderTest {

    private RequestBuilder rb;

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Before
    public void setup() {
        rb = new RequestBuilder(null);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 174 expected expected

SimpleName:IDENTIFIER 174 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 175 testInvalidCustomTextFieldName testInvalidCustomTextFieldName

SimpleName:IDENTIFIER 176 UpdateIndividualProfileRequest UpdateIndividualProfileRequest

SimpleName:IDENTIFIER 176 withCustomTextField withCustomTextField

StringLiteralExpr:LITERAL 176 "foo" "foo"

@Test(expected = IllegalArgumentException.class)
public void testInvalidCustomTextFieldName() {
    new UpdateIndividualProfileRequest().withCustomTextField("udf_text_13", "foo");
}

package com.p4square.ccbapi.serializer;

import com.p4square.ccbapi.model.*;
import org.junit.Before;
import org.junit.Test;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.Collections;
import static org.junit.Assert.*;

public class adhoc_IndividualProfileSerializerTest {

    private IndividualProfileSerializer serializer;

    @Before
    public void setUp() {
        serializer = new IndividualProfileSerializer();
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 184 expected expected

SimpleName:IDENTIFIER 184 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 185 testInvalidCustomDateFieldName testInvalidCustomDateFieldName

SimpleName:IDENTIFIER 186 UpdateIndividualProfileRequest UpdateIndividualProfileRequest

SimpleName:IDENTIFIER 186 withCustomDateField withCustomDateField

SimpleName:IDENTIFIER 186 LocalDate LocalDate

@Test(expected = IllegalArgumentException.class)
public void testInvalidCustomDateFieldName() {
    new UpdateIndividualProfileRequest().withCustomDateField("udf_date_7", LocalDate.of(1966, 2, 12));
}


SimpleName:IDENTIFIER 194 expected expected

SimpleName:IDENTIFIER 194 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 195 testInvalidCustomPulldownFieldName testInvalidCustomPulldownFieldName

SimpleName:IDENTIFIER 196 UpdateIndividualProfileRequest UpdateIndividualProfileRequest

SimpleName:IDENTIFIER 196 withCustomPulldownField withCustomPulldownField

@Test(expected = IllegalArgumentException.class)
public void testInvalidCustomPulldownFieldName() {
    new UpdateIndividualProfileRequest().withCustomPulldownField("udf_pulldown_7", 12);
}


SimpleName:IDENTIFIER 150 expected expected

SimpleName:IDENTIFIER 150 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 151 testGetLookupTableListWithNullType testGetLookupTableListWithNullType

SimpleName:IDENTIFIER 151 Exception Exception

SimpleName:IDENTIFIER 153 getLookupTable getLookupTable

SimpleName:IDENTIFIER 153 GetLookupTableRequest GetLookupTableRequest

@Test(expected = IllegalArgumentException.class)
public void testGetLookupTableListWithNullType() throws Exception {
    client.getLookupTable(new GetLookupTableRequest());
}

package com.p4square.ccbapi;

import com.p4square.ccbapi.exception.CCBErrorResponseException;
import com.p4square.ccbapi.exception.CCBRetryableErrorException;
import com.p4square.ccbapi.model.*;
import org.junit.Before;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.time.LocalDate;
import org.easymock.EasyMock;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_CCBAPIClientTest {

    private HTTPInterface mockHttpClient;

    private CCBAPIClient client;

    @Before
    public void setUp() throws Exception {
        mockHttpClient = EasyMock.mock(HTTPInterface.class);
        client = new TestCCBAPIClient(new URI("https://localhost:8080/api.php"), mockHttpClient);
    }

    private final class TestCCBAPIClient extends CCBAPIClient {

        public TestCCBAPIClient(final URI apiUri, final HTTPInterface mockHttpClient) {
            super(apiUri, mockHttpClient);
        }
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 292 expected expected

SimpleName:IDENTIFIER 292 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 293 testUpdateIndividualWithoutIndividualId testUpdateIndividualWithoutIndividualId

SimpleName:IDENTIFIER 293 Exception Exception

SimpleName:IDENTIFIER 295 request request

SimpleName:IDENTIFIER 295 UpdateIndividualProfileRequest UpdateIndividualProfileRequest

SimpleName:IDENTIFIER 296 withLegalFirstName withLegalFirstName

StringLiteralExpr:LITERAL 296 "Larabar" "Larabar"

SimpleName:IDENTIFIER 299 response response

SimpleName:IDENTIFIER 299 updateIndividualProfile updateIndividualProfile

SimpleName:IDENTIFIER 299 request request

@Test(expected = IllegalArgumentException.class)
public void testUpdateIndividualWithoutIndividualId() throws Exception {
    UpdateIndividualProfileRequest request = new UpdateIndividualProfileRequest().withLegalFirstName("Larabar");
    UpdateIndividualProfileResponse response = client.updateIndividualProfile(request);
}

This test ensures {@link CCBAPIClient#updateIndividualProfile(UpdateIndividualProfileRequest)}
throws an exception if the individualId property isn't set on the request.