SimpleName:IDENTIFIER 206 assertEquals assertEquals

SimpleName:IDENTIFIER 206 ProtocolSwitch ProtocolSwitch

SimpleName:IDENTIFIER 210 assertEquals assertEquals

SimpleName:IDENTIFIER 210 ProtocolSwitch ProtocolSwitch

SimpleName:IDENTIFIER 214 assertEquals assertEquals

SimpleName:IDENTIFIER 214 ProtocolSwitch ProtocolSwitch

SimpleName:IDENTIFIER 218 assertEquals assertEquals

SimpleName:IDENTIFIER 218 ProtocolSwitch ProtocolSwitch

SimpleName:IDENTIFIER 223 assertEquals assertEquals

SimpleName:IDENTIFIER 223 ProtocolSwitch ProtocolSwitch

SimpleName:IDENTIFIER 228 assertEquals assertEquals

SimpleName:IDENTIFIER 228 ProtocolSwitch ProtocolSwitch

SimpleName:IDENTIFIER 232 assertEquals assertEquals

SimpleName:IDENTIFIER 232 ProtocolSwitch ProtocolSwitch

SimpleName:IDENTIFIER 238 assertEquals assertEquals

SimpleName:IDENTIFIER 238 ProtocolSwitch ProtocolSwitch

SimpleName:IDENTIFIER 245 ProtocolSwitch ProtocolSwitch

@Test
public void test_bitSetToByte() {
    BitSet bs = new BitSet();
    bs.set(0);
    Assert.assertEquals(1, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(1);
    Assert.assertEquals(2, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(2);
    Assert.assertEquals(4, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(3);
    Assert.assertEquals(8, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(0);
    bs.set(1);
    Assert.assertEquals(3, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(2);
    bs.set(3);
    Assert.assertEquals(12, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(6);
    Assert.assertEquals(64, ProtocolSwitch.toByte(bs));
    bs.clear();
    for (int i = 0; i <= 6; ++i) {
        bs.set(i);
    }
    Assert.assertEquals(127, ProtocolSwitch.toByte(bs));
    bs.clear();
    for (int i = 0; i <= 7; ++i) {
        bs.set(i);
    }
    ProtocolSwitch.toByte(bs);
}

@Test(expected = IllegalArgumentException.class)
public void test_bitSetToByte() {
    BitSet bs = new BitSet();
    bs.set(0);
    Assert.assertEquals(1, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(1);
    Assert.assertEquals(2, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(2);
    Assert.assertEquals(4, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(3);
    Assert.assertEquals(8, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(0);
    bs.set(1);
    Assert.assertEquals(3, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(2);
    bs.set(3);
    Assert.assertEquals(12, ProtocolSwitch.toByte(bs));
    bs.clear();
    bs.set(6);
    Assert.assertEquals(64, ProtocolSwitch.toByte(bs));
    bs.clear();
    for (int i = 0; i <= 6; ++i) {
        bs.set(i);
    }
    Assert.assertEquals(127, ProtocolSwitch.toByte(bs));
    bs.clear();
    for (int i = 0; i <= 7; ++i) {
        bs.set(i);
    }
    ProtocolSwitch.toByte(bs);
}

package com.alipay.remoting.inner.utiltest;

import java.util.BitSet;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.alipay.remoting.config.switches.ProtocolSwitch;

public class adhoc_ProtocolSwitchTest {

    @BeforeClass
    public static void initClass() {
    }

    @Before
    public void init() {
    }

    @After
    public void stop() {
    }

    @AfterClass
    public static void afterClass() {
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 223 testError testError

SimpleName:IDENTIFIER 223 IOException IOException

@Test
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<DataPointFound> cursor = client.findDataPoints(series, interval, predicate, zone);
    cursor.iterator().next();
}

@Test(expected = TempoDBException.class)
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<DataPointFound> cursor = client.findDataPoints(series, interval, predicate, zone);
    cursor.iterator().next();
}

package com.tempodb;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Interval;
import org.joda.time.Period;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.rules.ExpectedException;

public class adhoc_FindDataPointsBySeriesTest {

    private static final DateTimeZone zone = DateTimeZone.UTC;

    private static final Series series = new Series("key1");

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

    private static final String json = "{" + "\"tz\":\"UTC\"," + "\"data\":[" + "{" + "\"interval\":{\"start\":\"2012-01-01T00:00:00.000+00:00\",\"end\":\"2012-01-02T00:00:00.000+00:00\"}," + "\"found\":{\"t\":\"2012-01-01T00:00:01.000+00:00\",\"v\":12.34}" + "}" + "]," + "\"predicate\":{" + "\"function\":\"max\"," + "\"period\":\"PT1M\"" + "}" + "}";

    private static final String json1 = "{" + "\"data\":[" + "{" + "\"interval\":{\"start\":\"2012-03-27T00:00:00.000+00:00\",\"end\":\"2012-03-27T00:01:00.000+00:00\"}," + "\"found\":{\"t\":\"2012-03-27T00:00:00.000+00:00\",\"v\":12.34}" + "}," + "{" + "\"interval\":{\"start\":\"2012-03-27T00:01:00.000+00:00\",\"end\":\"2012-03-27T00:02:00.000+00:00\"}," + "\"found\":{\"t\":\"2012-03-27T00:01:00.000+00:00\",\"v\":23.45}" + "}" + "]," + "\"tz\":\"UTC\"," + "\"predicate\":{" + "\"function\":\"max\"," + "\"period\":\"PT1M\"" + "}" + "}";

    private static final String json2 = "{" + "\"data\":[" + "{" + "\"interval\":{\"start\":\"2012-03-27T00:02:00.000+00:00\",\"end\":\"2012-03-27T00:03:00.000+00:00\"}," + "\"found\":{\"t\":\"2012-03-27T00:02:00.000+00:00\",\"v\":34.56}" + "}" + "]," + "\"tz\":\"UTC\"," + "\"predicate\":{" + "\"function\":\"max\"," + "\"period\":\"PT1M\"" + "}" + "}";

    private static final String jsonTz = "{" + "\"data\":[" + "{" + "\"interval\":{\"start\":\"2012-03-27T00:00:00.000+00:00\",\"end\":\"2012-03-27T00:01:00.000+00:00\"}," + "\"found\":{\"t\":\"2012-03-27T00:00:00.000-05:00\",\"v\":12.34}" + "}," + "{" + "\"interval\":{\"start\":\"2012-03-27T00:01:00.000+00:00\",\"end\":\"2012-03-27T00:02:00.000+00:00\"}," + "\"found\":{\"t\":\"2012-03-27T00:01:00.000-05:00\",\"v\":23.45}" + "}" + "]," + "\"tz\":\"America/Chicago\"," + "\"predicate\":{" + "\"function\":\"max\"," + "\"period\":\"PT1M\"" + "}" + "}";

    private static final DateTime start = new DateTime(2012, 3, 27, 0, 0, 0, 0, zone);

    private static final DateTime end = new DateTime(2012, 3, 28, 0, 0, 0, 0, zone);

    private static final Interval interval = new Interval(start, end);

    private static final Predicate predicate = new Predicate(Period.minutes(1), "max");

    private static final DateTime dt0 = new DateTime(2012, 3, 27, 0, 0, 0, 0, zone);

    private static final DateTime dt1 = new DateTime(2012, 3, 27, 0, 1, 0, 0, zone);

    private static final DateTime dt2 = new DateTime(2012, 3, 27, 0, 2, 0, 0, zone);

    private static final DateTime dt3 = new DateTime(2012, 3, 27, 0, 3, 0, 0, zone);
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 247 testError testError

SimpleName:IDENTIFIER 247 IOException IOException

@Test
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<DataPoint> cursor = client.readDataPoints(series, interval, zone, rollup, null);
    cursor.iterator().next();
}

@Test(expected = TempoDBException.class)
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<DataPoint> cursor = client.readDataPoints(series, interval, zone, rollup, null);
    cursor.iterator().next();
}

package com.tempodb;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Interval;
import org.joda.time.Period;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.rules.ExpectedException;

public class adhoc_ReadDataPointsBySeriesTest {

    private static final DateTimeZone zone = DateTimeZone.UTC;

    private static final Series series = new Series("key1");

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

    private static final String json = "{" + "\"rollup\":{" + "\"fold\":\"sum\"," + "\"period\":\"PT1H\"" + "}," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-01-01T00:00:00.000Z\",\"v\":12.34}" + "]" + "}";

    private static final String json1 = "{" + "\"rollup\":null," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-03-27T05:00:00.000Z\",\"v\":12.34}," + "{\"t\":\"2012-03-27T05:01:00.000Z\",\"v\":23.45}" + "]" + "}";

    private static final String json2 = "{" + "\"rollup\":null," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-03-27T05:02:00.000Z\",\"v\":34.56}" + "]" + "}";

    private static final String jsonTz = "{" + "\"rollup\":null," + "\"tz\":\"America/Chicago\"," + "\"data\":[" + "{\"t\":\"2012-01-01T00:00:00.000-06:00\",\"v\":34.56}" + "]" + "}";

    private static final DateTime start = new DateTime(2012, 1, 1, 0, 0, 0, 0, zone);

    private static final DateTime end = new DateTime(2012, 1, 2, 0, 0, 0, 0, zone);

    private static final Interval interval = new Interval(start, end);

    private static final Rollup rollup = new Rollup(Period.minutes(1), Fold.SUM);
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 294 testError testError

SimpleName:IDENTIFIER 294 IOException IOException

@Test
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Filter filter = new Filter();
    filter.addKey("key1");
    Cursor<DataPoint> cursor = client.readDataPoints(filter, interval, zone, aggregation);
    cursor.iterator().next();
}

@Test(expected = TempoDBException.class)
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Filter filter = new Filter();
    filter.addKey("key1");
    Cursor<DataPoint> cursor = client.readDataPoints(filter, interval, zone, aggregation);
    cursor.iterator().next();
}

package com.tempodb;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Interval;
import org.joda.time.Period;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.rules.ExpectedException;

public class adhoc_ReadDataPointsByFilterTest {

    private static final DateTimeZone zone = DateTimeZone.UTC;

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

    private static final String json = "{" + "\"rollup\":{" + "\"fold\":\"sum\"," + "\"period\":\"PT1H\"" + "}," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-01-01T00:00:00.000Z\",\"v\":12.34}" + "]" + "}";

    private static final String json1 = "{" + "\"rollup\":null," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-03-27T05:00:00.000Z\",\"v\":12.34}," + "{\"t\":\"2012-03-27T05:01:00.000Z\",\"v\":23.45}" + "]" + "}";

    private static final String json2 = "{" + "\"rollup\":null," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-03-27T05:02:00.000Z\",\"v\":34.56}" + "]" + "}";

    private static final String jsonTz = "{" + "\"rollup\":null," + "\"tz\":\"America/Chicago\"," + "\"data\":[" + "{\"t\":\"2012-01-01T00:00:00.000-06:00\",\"v\":34.56}" + "]" + "}";

    private static final DateTime start = new DateTime(2012, 1, 1, 0, 0, 0, 0, zone);

    private static final DateTime end = new DateTime(2012, 1, 2, 0, 0, 0, 0, zone);

    private static final Interval interval = new Interval(start, end);

    private static final Rollup rollup = new Rollup(Period.minutes(1), Fold.SUM);

    private static final Aggregation aggregation = new Aggregation(Fold.SUM);
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 232 testError testError

SimpleName:IDENTIFIER 232 IOException IOException

@Test
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<SingleValue> cursor = client.readSingleValue(filter, timestamp, zone, Direction.EXACT);
    cursor.iterator().next();
}

@Test(expected = TempoDBException.class)
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<SingleValue> cursor = client.readSingleValue(filter, timestamp, zone, Direction.EXACT);
    cursor.iterator().next();
}

package com.tempodb;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.rules.ExpectedException;

public class adhoc_ReadSingleValueByFilterTest {

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

    private static final String json = "[{" + "\"series\":{" + "\"id\":\"id1\"," + "\"key\":\"key1\"," + "\"name\":\"name1\"," + "\"tags\":[]," + "\"attributes\":{}" + "}," + "\"data\":{" + "\"t\":\"2012-01-01T00:00:01.000Z\"," + "\"v\":12.34" + "}," + "\"tz\":\"UTC\"" + "}]";

    private static final String json1 = "[" + "{" + "\"series\":{" + "\"id\":\"id1\"," + "\"key\":\"key1\"," + "\"name\":\"name1\"," + "\"tags\":[]," + "\"attributes\":{}" + "}," + "\"data\":{" + "\"t\":\"2012-01-01T00:00:01.000Z\"," + "\"v\":12.34" + "}," + "\"tz\":\"UTC\"" + "}," + "{" + "\"series\":{" + "\"id\":\"id2\"," + "\"key\":\"key2\"," + "\"name\":\"name2\"," + "\"tags\":[]," + "\"attributes\":{}" + "}," + "\"data\":{" + "\"t\":\"2012-01-01T00:00:01.000Z\"," + "\"v\":23.45" + "}," + "\"tz\":\"UTC\"" + "}" + "]";

    private static final String json2 = "[" + "{" + "\"series\":{" + "\"id\":\"id3\"," + "\"key\":\"key3\"," + "\"name\":\"name3\"," + "\"tags\":[]," + "\"attributes\":{}" + "}," + "\"data\":{" + "\"t\":\"2012-01-01T00:00:01.000Z\"," + "\"v\":34.56" + "}," + "\"tz\":\"UTC\"" + "}" + "]";

    private static final String jsonTz = "[{" + "\"series\":{" + "\"id\":\"id1\"," + "\"key\":\"key1\"," + "\"name\":\"name1\"," + "\"tags\":[]," + "\"attributes\":{}" + "}," + "\"data\":{" + "\"t\":\"2012-01-01T00:00:01.000-06:00\"," + "\"v\":12.34" + "}," + "\"tz\":\"America/Chicago\"" + "}]";

    private static final DateTimeZone zone = DateTimeZone.UTC;

    private static final Series series1 = new Series("key1", "name1", new HashSet<String>(), new HashMap<String, String>());

    private static final Series series2 = new Series("key2", "name2", new HashSet<String>(), new HashMap<String, String>());

    private static final Series series3 = new Series("key3", "name3", new HashSet<String>(), new HashMap<String, String>());

    private static final DateTime timestamp = new DateTime(2012, 1, 1, 0, 0, 1, 0, zone);

    private static final Filter filter = new Filter();
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 315 testError testError

SimpleName:IDENTIFIER 315 IOException IOException

@Test
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Filter filter = new Filter();
    filter.addKey("key1");
    Cursor<MultiDataPoint> cursor = client.readMultiDataPoints(filter, interval, zone);
    cursor.iterator().next();
}

@Test(expected = TempoDBException.class)
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Filter filter = new Filter();
    filter.addKey("key1");
    Cursor<MultiDataPoint> cursor = client.readMultiDataPoints(filter, interval, zone);
    cursor.iterator().next();
}

package com.tempodb;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Interval;
import org.joda.time.Period;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.rules.ExpectedException;

public class adhoc_ReadMultiDataPointsTest {

    private static final DateTimeZone zone = DateTimeZone.UTC;

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

    private static final String json = "{" + "\"rollup\":{" + "\"fold\":\"sum\"," + "\"period\":\"PT1H\"" + "}," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-01-01T00:00:00.000Z\",\"v\":{\"key1\":12.34,\"key2\":23.45}}" + "]" + "}";

    private static final String json1 = "{" + "\"rollup\":null," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-03-27T05:00:00.000Z\",\"v\":{\"key1\":12.34,\"key2\":23.45}}," + "{\"t\":\"2012-03-27T05:01:00.000Z\",\"v\":{\"key1\":23.45,\"key2\":34.56}}" + "]" + "}";

    private static final String json2 = "{" + "\"rollup\":null," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-03-27T05:02:00.000Z\",\"v\":{\"key1\":34.56,\"key2\":45.67}}" + "]" + "}";

    private static final String jsonTz = "{" + "\"rollup\":null," + "\"tz\":\"America/Chicago\"," + "\"data\":[" + "{\"t\":\"2012-01-01T00:00:00.000-06:00\",\"v\":{\"key1\":34.56,\"key2\":45.67}}" + "]" + "}";

    private static final DateTime start = new DateTime(2012, 1, 1, 0, 0, 0, 0, zone);

    private static final DateTime end = new DateTime(2012, 1, 2, 0, 0, 0, 0, zone);

    private static final Interval interval = new Interval(start, end);

    private static final Rollup rollup = new Rollup(Period.minutes(1), Fold.SUM);

    private static final Map<String, Number> data1;

    private static final Map<String, Number> data2;

    private static final Map<String, Number> data3;

    static {
        data1 = new HashMap<String, Number>();
        data1.put("key1", 12.34);
        data1.put("key2", 23.45);
        data2 = new HashMap<String, Number>();
        data2.put("key1", 23.45);
        data2.put("key2", 34.56);
        data3 = new HashMap<String, Number>();
        data3.put("key1", 34.56);
        data3.put("key2", 45.67);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 140 testError testError

SimpleName:IDENTIFIER 140 IOException IOException

@Test
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<Series> cursor = client.getSeries(filter);
    cursor.iterator().next();
}

@Test(expected = TempoDBException.class)
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<Series> cursor = client.getSeries(filter);
    cursor.iterator().next();
}

package com.tempodb;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.rules.ExpectedException;

public class adhoc_GetSeriesByFilterTest {

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

    private static final String json = "[" + "{\"id\":\"id1\",\"key\":\"key1\",\"name\":\"name1\",\"tags\":[],\"attributes\":{}}" + "]";

    private static final String json1 = "[" + "{\"id\":\"id1\",\"key\":\"key1\",\"name\":\"name1\",\"tags\":[],\"attributes\":{}}," + "{\"id\":\"id2\",\"key\":\"key2\",\"name\":\"name2\",\"tags\":[],\"attributes\":{}}" + "]";

    private static final String json2 = "[" + "{\"id\":\"id3\",\"key\":\"key3\",\"name\":\"name3\",\"tags\":[],\"attributes\":{}}" + "]";

    private static final Series series1 = new Series("key1", "name1", new HashSet<String>(), new HashMap<String, String>());

    private static final Series series2 = new Series("key2", "name2", new HashSet<String>(), new HashMap<String, String>());

    private static final Series series3 = new Series("key3", "name3", new HashSet<String>(), new HashMap<String, String>());

    private static final Filter filter = new Filter();
    /*TEST PLACEHOLDER*/
}


@Test
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<MultiDataPoint> cursor = client.readMultiRollupDataPoints(series, new Interval(start, end), zone, rollup, null);
    cursor.iterator().next();
}

@Test(expected = TempoDBException.class)
public void testError() throws IOException {
    HttpResponse response = Util.getResponse(403, "You are forbidden");
    HttpClient mockClient = Util.getMockHttpClient(response);
    Client client = Util.getClient(mockClient);
    Cursor<MultiDataPoint> cursor = client.readMultiRollupDataPoints(series, new Interval(start, end), zone, rollup, null);
    cursor.iterator().next();
}

package com.tempodb;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.message.BasicNameValuePair;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Interval;
import org.joda.time.Period;
import org.junit.*;
import static org.junit.Assert.*;
import org.junit.rules.ExpectedException;

public class adhoc_ReadMultiRollupDataPointsTest {

    private static final DateTimeZone zone = DateTimeZone.UTC;

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

    private static final String json = "{" + "\"series\":{\"id\":\"id1\",\"key\":\"key\",\"name\":\"\",\"tags\":[],\"attributes\":{}}," + "\"rollup\":{" + "\"folds\":[\"sum\",\"max\"]," + "\"period\":\"PT1H\"" + "}," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-01-01T00:00:00.000Z\",\"v\":{\"sum\":12.34,\"max\":23.45}}" + "]" + "}";

    private static final String json1 = "{" + "\"series\":{\"id\":\"id1\",\"key\":\"key\",\"name\":\"\",\"tags\":[],\"attributes\":{}}," + "\"rollup\":{" + "\"folds\":[\"sum\",\"max\"]," + "\"period\":\"PT1H\"" + "}," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-03-27T05:00:00.000Z\",\"v\":{\"sum\":12.34,\"max\":23.45}}," + "{\"t\":\"2012-03-27T05:01:00.000Z\",\"v\":{\"sum\":23.45,\"max\":34.56}}" + "]" + "}";

    private static final String json2 = "{" + "\"series\":{\"id\":\"id1\",\"key\":\"key\",\"name\":\"\",\"tags\":[],\"attributes\":{}}," + "\"rollup\":{" + "\"folds\":[\"sum\",\"max\"]," + "\"period\":\"PT1H\"" + "}," + "\"tz\":\"UTC\"," + "\"data\":[" + "{\"t\":\"2012-03-27T05:02:00.000Z\",\"v\":{\"sum\":34.56,\"max\":45.67}}" + "]" + "}";

    private static final String jsonTz = "{" + "\"series\":{\"id\":\"id1\",\"key\":\"key\",\"name\":\"\",\"tags\":[],\"attributes\":{}}," + "\"rollup\":{" + "\"folds\":[\"sum\",\"max\"]," + "\"period\":\"PT1H\"" + "}," + "\"tz\":\"America/Chicago\"," + "\"data\":[" + "{\"t\":\"2012-01-01T00:00:00.000-06:00\",\"v\":{\"sum\":34.56,\"max\":45.67}}" + "]" + "}";

    private static final DateTime start = new DateTime(2012, 1, 1, 0, 0, 0, 0, zone);

    private static final DateTime end = new DateTime(2012, 1, 2, 0, 0, 0, 0, zone);

    private static final Interval interval = new Interval(start, end);

    private static final MultiRollup rollup = new MultiRollup(Period.minutes(1), new Fold[] { Fold.SUM, Fold.MAX });

    private static final Series series = new Series("key");

    private static final Map<String, Number> data1;

    private static final Map<String, Number> data2;

    private static final Map<String, Number> data3;

    static {
        data1 = new HashMap<String, Number>();
        data1.put("sum", 12.34);
        data1.put("max", 23.45);
        data2 = new HashMap<String, Number>();
        data2.put("sum", 23.45);
        data2.put("max", 34.56);
        data3 = new HashMap<String, Number>();
        data3.put("sum", 34.56);
        data3.put("max", 45.67);
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 44 expected expected

SimpleName:IDENTIFIER 44 PropertiesException PropertiesException

SimpleName:IDENTIFIER 47 PropertiesUtils PropertiesUtils

SimpleName:IDENTIFIER 47 getPropertiesFromCache getPropertiesFromCache

@Test(expected = PropertiesException.class)
public void getPropertiesFromCache_noSuchProperties_throwPropertiesException() {
    PropertiesUtils.getPropertiesFromCache("test.properties");
}

package org.codelogger.utils;

import static org.codelogger.utils.PrintUtils.println;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.Properties;
import org.codelogger.utils.PropertiesUtils;
import org.codelogger.utils.exceptions.PropertiesException;
import org.junit.Test;

public class adhoc_PropertiesUtilsTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 28 expected expected

SimpleName:IDENTIFIER 28 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 31 referencedFields referencedFields

SimpleName:IDENTIFIER 31 ReflectionUtils ReflectionUtils

SimpleName:IDENTIFIER 31 getReferenceAttributesList getReferenceAttributesList

SimpleName:IDENTIFIER 31 SimpleDbReferencesEntity SimpleDbReferencesEntity

SimpleName:IDENTIFIER 32 MetadataParser MetadataParser

SimpleName:IDENTIFIER 32 validateReferenceAnnotation validateReferenceAnnotation

SimpleName:IDENTIFIER 32 referencedFields referencedFields

@Test(expected = IllegalStateException.class)
public void validateReferenceAnnotation_should_fail_for_missing_Id() {
    List<Field> referencedFields = ReflectionUtils.getReferenceAttributesList(SimpleDbReferencesEntity.class);
    MetadataParser.validateReferenceAnnotation(referencedFields.get(2));
}

package org.springframework.data.simpledb.core;

import org.junit.Test;
import org.springframework.data.simpledb.core.domain.SimpleDbReferencesEntity;
import org.springframework.data.simpledb.reflection.MetadataParser;
import org.springframework.data.simpledb.reflection.ReflectionUtils;
import java.lang.reflect.Field;
import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

public class adhoc_NestedReferencedDomainTest {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 35 expected expected

SimpleName:IDENTIFIER 35 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 38 referencedFields referencedFields

SimpleName:IDENTIFIER 38 ReflectionUtils ReflectionUtils

SimpleName:IDENTIFIER 38 getReferenceAttributesList getReferenceAttributesList

SimpleName:IDENTIFIER 38 SimpleDbReferencesEntity SimpleDbReferencesEntity

SimpleName:IDENTIFIER 39 MetadataParser MetadataParser

SimpleName:IDENTIFIER 39 validateReferenceAnnotation validateReferenceAnnotation

SimpleName:IDENTIFIER 39 referencedFields referencedFields

@Test(expected = IllegalStateException.class)
public void validateReferenceAnnotation_should_fail_for_not_nested_field_type() {
    List<Field> referencedFields = ReflectionUtils.getReferenceAttributesList(SimpleDbReferencesEntity.class);
    MetadataParser.validateReferenceAnnotation(referencedFields.get(0));
}


Name:IDENTIFIER 8 SuppressWarnings SuppressWarnings

StringLiteralExpr:LITERAL 8 "rawtypes" "rawtypes"

StringLiteralExpr:LITERAL 8 "unchecked" "unchecked"

SimpleName:IDENTIFIER 9 expected expected

SimpleName:IDENTIFIER 9 IllegalArgumentException IllegalArgumentException

SimpleName:IDENTIFIER 11 Mockito Mockito

SimpleName:IDENTIFIER 11 SimpleDbQueryMethod SimpleDbQueryMethod

SimpleName:IDENTIFIER 12 Mockito Mockito

SimpleName:IDENTIFIER 12 getDomainClazz getDomainClazz

SimpleName:IDENTIFIER 12 thenReturn thenReturn

SimpleName:IDENTIFIER 12 SampleEntity SampleEntity

SimpleName:IDENTIFIER 14 repositoryQuery repositoryQuery

SimpleName:IDENTIFIER 14 SimpleDbRepositoryQuery SimpleDbRepositoryQuery

SimpleName:IDENTIFIER 15 repositoryQuery repositoryQuery

SimpleName:IDENTIFIER 15 assertNotHavingNestedQueryParameters assertNotHavingNestedQueryParameters

@SuppressWarnings({ "rawtypes", "unchecked" })
@Test(expected = IllegalArgumentException.class)
public void assertNotHavingNestedQueryParameters_should_fail_for_nested_attributes() {
    SimpleDbQueryMethod method = Mockito.mock(SimpleDbQueryMethod.class);
    Mockito.when(method.getDomainClazz()).thenReturn((Class) SampleEntity.class);
    SimpleDbRepositoryQuery repositoryQuery = new SimpleDbRepositoryQuery(method, null);
    repositoryQuery.assertNotHavingNestedQueryParameters("select sampleNestedAttribute from SampleEntity");
}

package org.springframework.data.simpledb.query;

import org.junit.Test;
import org.mockito.Mockito;

public class adhoc_SimpleDbRepositoryQueryTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 70 expected expected

SimpleName:IDENTIFIER 70 NoSuchFieldException NoSuchFieldException

SimpleName:IDENTIFIER 71 testFindFieldNonExisting testFindFieldNonExisting

SimpleName:IDENTIFIER 71 Exception Exception

SimpleName:IDENTIFIER 72 resolver resolver

SimpleName:IDENTIFIER 72 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 72 TestSubClass TestSubClass

SimpleName:IDENTIFIER 73 assertThat assertThat

SimpleName:IDENTIFIER 73 resolver resolver

SimpleName:IDENTIFIER 73 findField findField

PrimitiveType:KEYWORD 73 boolean boolean

SimpleName:IDENTIFIER 73 Annotation Annotation

SimpleName:IDENTIFIER 73 notNullValue notNullValue

@Test(expected = NoSuchFieldException.class)
public void testFindFieldNonExisting() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    assertThat(resolver.findField("a", boolean.class, new Annotation[0]), notNullValue());
}

package com.almondtools.picklock;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import org.junit.Test;

@SuppressWarnings("unused")
public class adhoc_InvocationResolverTest {

    interface Getters {

        String getS();

        int getI();

        boolean getB();
    }

    interface Setters {

        void setS(String s);

        void setI(int i);

        void setB(boolean b);
    }

    interface ConvertibleSetters {

        void setConvertible(@Convert("ConvertibleObject") ConvertibleInterface o);
    }

    interface ConvertibleGetters {

        @Convert("ConvertibleObject")
        ConvertibleInterface getConvertible();
    }

    interface BadGetters {

        String getA();
    }

    interface BadSetters {

        void setA(boolean b);
    }

    interface Methods {

        void methoda();

        void methodb(String s);

        void methodc(String s) throws Exception;

        String methodd(String s) throws Exception;

        String methode(String s) throws Exception;
    }

    interface BadMethods {

        String methodz();

        String methoda();

        void methodb();

        void methodb(int i);

        void methodb(String s) throws Exception;

        String methode(String s) throws IOException;
    }

    interface ConvertibleMethods {

        void methoda(@Convert("ConvertibleObject") ConvertibleInterface o);

        @Convert("ConvertibleObject")
        ConvertibleInterface methodb();
    }

    interface NonConvertibleMethods {

        void methoda(ConvertibleInterface o);

        ConvertibleInterface methodb();
    }

    interface FailedConvertibleMethods {

        void methoda(@Convert ConvertibleInterface o);

        @Convert
        ConvertibleInterface methodb();
    }

    interface ConvertibleInterface {

        String getContent();
    }

    private static class TestClass {

        private String s;

        private int i;

        private String methode(String b) throws Exception {
            return null;
        }
    }

    private static class TestSubClass extends TestClass {

        private boolean b;

        private String method0() {
            return null;
        }

        private void methoda() {
        }

        private void methodb(String b) {
        }

        private void methodc(String b) throws Exception {
        }

        private String methodd(String b) throws Exception {
            return null;
        }
    }

    private static class ConvertibleTestClass {

        private ConvertibleObject convertible;

        private void methoda(ConvertibleObject o) {
        }

        private ConvertibleObject methodb() {
            return null;
        }
    }

    private static class ConvertibleObject {

        private String content = "content";
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 76 expected expected

SimpleName:IDENTIFIER 76 NoSuchFieldException NoSuchFieldException

SimpleName:IDENTIFIER 77 testFindSuperFieldWronglyTyped testFindSuperFieldWronglyTyped

SimpleName:IDENTIFIER 77 Exception Exception

SimpleName:IDENTIFIER 78 resolver resolver

SimpleName:IDENTIFIER 78 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 78 TestSubClass TestSubClass

SimpleName:IDENTIFIER 79 assertThat assertThat

SimpleName:IDENTIFIER 79 resolver resolver

SimpleName:IDENTIFIER 79 findField findField

PrimitiveType:KEYWORD 79 boolean boolean

SimpleName:IDENTIFIER 79 Annotation Annotation

SimpleName:IDENTIFIER 79 notNullValue notNullValue

@Test(expected = NoSuchFieldException.class)
public void testFindSuperFieldWronglyTyped() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    assertThat(resolver.findField("s", boolean.class, new Annotation[0]), notNullValue());
}

SimpleName:IDENTIFIER 82 expected expected

SimpleName:IDENTIFIER 82 NoSuchFieldException NoSuchFieldException

SimpleName:IDENTIFIER 83 testFindFieldWronglyTyped testFindFieldWronglyTyped

SimpleName:IDENTIFIER 83 Exception Exception

SimpleName:IDENTIFIER 84 resolver resolver

SimpleName:IDENTIFIER 84 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 84 TestSubClass TestSubClass

SimpleName:IDENTIFIER 85 assertThat assertThat

SimpleName:IDENTIFIER 85 resolver resolver

SimpleName:IDENTIFIER 85 findField findField

SimpleName:IDENTIFIER 85 Annotation Annotation

SimpleName:IDENTIFIER 85 notNullValue notNullValue

@Test(expected = NoSuchFieldException.class)
public void testFindFieldWronglyTyped() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    assertThat(resolver.findField("b", String.class, new Annotation[0]), notNullValue());
}


SimpleName:IDENTIFIER 109 expected expected

SimpleName:IDENTIFIER 109 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 110 testCreateMethodInvocatorNonExisting testCreateMethodInvocatorNonExisting

SimpleName:IDENTIFIER 110 Exception Exception

SimpleName:IDENTIFIER 111 resolver resolver

SimpleName:IDENTIFIER 111 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 111 TestSubClass TestSubClass

resolver = new InvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 112 badmethods badmethods

SimpleName:IDENTIFIER 112 BadMethods BadMethods

SimpleName:IDENTIFIER 112 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 113 resolver resolver

SimpleName:IDENTIFIER 113 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 113 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorNonExisting() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[0]);
}

SimpleName:IDENTIFIER 116 expected expected

SimpleName:IDENTIFIER 116 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 117 Exception Exception

SimpleName:IDENTIFIER 118 resolver resolver

SimpleName:IDENTIFIER 118 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 118 TestSubClass TestSubClass

resolver = new InvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 119 badmethods badmethods

SimpleName:IDENTIFIER 119 BadMethods BadMethods

SimpleName:IDENTIFIER 119 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 120 resolver resolver

SimpleName:IDENTIFIER 120 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 120 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglyReturnType() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[1]);
}

SimpleName:IDENTIFIER 123 expected expected

SimpleName:IDENTIFIER 123 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 124 Exception Exception

SimpleName:IDENTIFIER 125 resolver resolver

SimpleName:IDENTIFIER 125 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 125 TestSubClass TestSubClass

resolver = new InvocationResolver(TestSubClass.class)

InvocationResolver resolver = new InvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 126 badmethods badmethods

SimpleName:IDENTIFIER 126 BadMethods BadMethods

SimpleName:IDENTIFIER 126 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 127 resolver resolver

SimpleName:IDENTIFIER 127 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 127 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglySignature() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[2]);
}

SimpleName:IDENTIFIER 130 expected expected

SimpleName:IDENTIFIER 130 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 131 testCreateMethodInvocatorWronglyTyped testCreateMethodInvocatorWronglyTyped

SimpleName:IDENTIFIER 131 Exception Exception

SimpleName:IDENTIFIER 132 resolver resolver

SimpleName:IDENTIFIER 132 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 132 TestSubClass TestSubClass

resolver = new InvocationResolver(TestSubClass.class)

InvocationResolver resolver = new InvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 133 badmethods badmethods

SimpleName:IDENTIFIER 133 BadMethods BadMethods

SimpleName:IDENTIFIER 133 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 134 resolver resolver

SimpleName:IDENTIFIER 134 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 134 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglyTyped() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[3]);
}

SimpleName:IDENTIFIER 137 expected expected

SimpleName:IDENTIFIER 137 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 138 Exception Exception

SimpleName:IDENTIFIER 139 resolver resolver

SimpleName:IDENTIFIER 139 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 139 TestSubClass TestSubClass

resolver = new InvocationResolver(TestSubClass.class)

InvocationResolver resolver = new InvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 140 badmethods badmethods

SimpleName:IDENTIFIER 140 BadMethods BadMethods

SimpleName:IDENTIFIER 140 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 141 resolver resolver

SimpleName:IDENTIFIER 141 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 141 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglyExceptionTyped() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[4]);
}

SimpleName:IDENTIFIER 144 expected expected

SimpleName:IDENTIFIER 144 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 145 Exception Exception

SimpleName:IDENTIFIER 146 resolver resolver

SimpleName:IDENTIFIER 146 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 146 TestSubClass TestSubClass

resolver = new InvocationResolver(TestSubClass.class)

InvocationResolver resolver = new InvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 147 badmethods badmethods

SimpleName:IDENTIFIER 147 BadMethods BadMethods

SimpleName:IDENTIFIER 147 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 148 resolver resolver

SimpleName:IDENTIFIER 148 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 148 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglyExceptionTypedInSuperclass() throws Exception {
    InvocationResolver resolver = new InvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[5]);
}

SimpleName:IDENTIFIER 151 expected expected

SimpleName:IDENTIFIER 151 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 152 Exception Exception

SimpleName:IDENTIFIER 153 resolver resolver

SimpleName:IDENTIFIER 153 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 153 ConvertibleTestClass ConvertibleTestClass

resolver = new InvocationResolver(ConvertibleTestClass.class)

SimpleName:IDENTIFIER 154 badmethods badmethods

SimpleName:IDENTIFIER 154 NonConvertibleMethods NonConvertibleMethods

SimpleName:IDENTIFIER 154 getDeclaredMethods getDeclaredMethods

Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods()

Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 155 resolver resolver

SimpleName:IDENTIFIER 155 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 155 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorNotConvertibleArguments() throws Exception {
    InvocationResolver resolver = new InvocationResolver(ConvertibleTestClass.class);
    Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[0]);
}

SimpleName:IDENTIFIER 158 expected expected

SimpleName:IDENTIFIER 158 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 159 Exception Exception

SimpleName:IDENTIFIER 160 resolver resolver

SimpleName:IDENTIFIER 160 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 160 ConvertibleTestClass ConvertibleTestClass

resolver = new InvocationResolver(ConvertibleTestClass.class)

SimpleName:IDENTIFIER 161 badmethods badmethods

SimpleName:IDENTIFIER 161 NonConvertibleMethods NonConvertibleMethods

SimpleName:IDENTIFIER 161 getDeclaredMethods getDeclaredMethods

Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods()

Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 162 resolver resolver

SimpleName:IDENTIFIER 162 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 162 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorNotConvertibleResult() throws Exception {
    InvocationResolver resolver = new InvocationResolver(ConvertibleTestClass.class);
    Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[1]);
}

SimpleName:IDENTIFIER 165 expected expected

SimpleName:IDENTIFIER 165 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 166 Exception Exception

SimpleName:IDENTIFIER 167 resolver resolver

SimpleName:IDENTIFIER 167 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 167 ConvertibleTestClass ConvertibleTestClass

resolver = new InvocationResolver(ConvertibleTestClass.class)

SimpleName:IDENTIFIER 168 badmethods badmethods

SimpleName:IDENTIFIER 168 FailedConvertibleMethods FailedConvertibleMethods

SimpleName:IDENTIFIER 168 getDeclaredMethods getDeclaredMethods

SimpleName:IDENTIFIER 169 resolver resolver

SimpleName:IDENTIFIER 169 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 169 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorFailedConvertibleArguments() throws Exception {
    InvocationResolver resolver = new InvocationResolver(ConvertibleTestClass.class);
    Method[] badmethods = FailedConvertibleMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[0]);
}

SimpleName:IDENTIFIER 172 expected expected

SimpleName:IDENTIFIER 172 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 173 Exception Exception

SimpleName:IDENTIFIER 174 resolver resolver

SimpleName:IDENTIFIER 174 InvocationResolver InvocationResolver

SimpleName:IDENTIFIER 174 ConvertibleTestClass ConvertibleTestClass

resolver = new InvocationResolver(ConvertibleTestClass.class)

SimpleName:IDENTIFIER 175 badmethods badmethods

SimpleName:IDENTIFIER 175 FailedConvertibleMethods FailedConvertibleMethods

SimpleName:IDENTIFIER 175 getDeclaredMethods getDeclaredMethods

SimpleName:IDENTIFIER 176 resolver resolver

SimpleName:IDENTIFIER 176 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 176 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorFailedConvertibleResult() throws Exception {
    InvocationResolver resolver = new InvocationResolver(ConvertibleTestClass.class);
    Method[] badmethods = FailedConvertibleMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[1]);
}


SimpleName:IDENTIFIER 33 expected expected

SimpleName:IDENTIFIER 33 NoSuchFieldException NoSuchFieldException

SimpleName:IDENTIFIER 34 testFindFieldNonExisting testFindFieldNonExisting

SimpleName:IDENTIFIER 34 Exception Exception

SimpleName:IDENTIFIER 35 resolver resolver

SimpleName:IDENTIFIER 35 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 35 TestSubClass TestSubClass

SimpleName:IDENTIFIER 36 resolver resolver

SimpleName:IDENTIFIER 36 findField findField

PrimitiveType:KEYWORD 36 boolean boolean

SimpleName:IDENTIFIER 36 Annotation Annotation

@Test(expected = NoSuchFieldException.class)
public void testFindFieldNonExisting() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    resolver.findField("a", boolean.class, new Annotation[0]);
}

package com.almondtools.picklock;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.junit.Assert.assertThat;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import org.junit.Test;
import com.almondtools.picklock.InvocationResolverTest.ConvertibleInterface;

@SuppressWarnings("unused")
public class adhoc_StaticInvocationResolverTest {

    interface Getters {

        String getSt();

        int getIN();

        boolean getBo();
    }

    interface Setters {

        void setSt(String s);

        void setIN(int i);

        void setBo(boolean b);
    }

    interface ConvertibleSetters {

        void setConvertible(@Convert("ConvertibleObject") ConvertibleInterface o);
    }

    interface ConvertibleGetters {

        @Convert("ConvertibleObject")
        ConvertibleInterface getConvertible();
    }

    interface BadGetters {

        String getA();
    }

    interface BadSetters {

        void setA(boolean b);
    }

    interface Methods {

        void methoda();

        void methodb(String s);

        void methodc(String s) throws Exception;

        String methodd(String s) throws Exception;

        String methode(String s) throws Exception;
    }

    interface BadMethods {

        String methodz();

        void methodb();

        void methodb(int i);

        void methodb(String s) throws Exception;

        String methode(String s) throws IOException;

        String methoda();
    }

    interface ConvertibleMethods {

        void methoda(@Convert("ConvertibleObject") ConvertibleInterface o);

        @Convert("ConvertibleObject")
        ConvertibleInterface methodb();
    }

    interface NonConvertibleMethods {

        void methoda(ConvertibleInterface o);

        ConvertibleInterface methodb();
    }

    interface FailedConvertibleMethods {

        void methoda(@Convert ConvertibleInterface o);

        @Convert
        ConvertibleInterface methodb();
    }

    interface Constructors {

        TestSubClass create();

        TestSubClass create(String s);

        TestSubClass create(int i) throws Exception;
    }

    interface BadConstructors {

        TestSubClass create(String s, boolean b);

        TestSubClass create(boolean b);

        TestSubClass create(int i) throws IOException;
    }

    interface ConvertibleConstructors {

        @Convert("ConvertibleTestClass")
        ConvertibleInterface create();

        @Convert("ConvertibleTestClass")
        ConvertibleInterface create(@Convert("ConvertibleTestClass") ConvertibleInterface o);
    }

    interface NonConvertibleConstructors {

        @Convert
        ConvertibleInterface create(@Convert ConvertibleInterface i);
    }

    private static class TestClass {

        private static String st;

        private static final int IN = 0;

        private static String methode(String b) throws Exception {
            return null;
        }
    }

    private static class TestSubClass extends TestClass {

        private static boolean bo;

        private TestSubClass() {
        }

        private TestSubClass(String s) {
        }

        private TestSubClass(int i) throws Exception {
        }

        private static void methoda() {
        }

        private static void methodb(String b) {
        }

        private static void methodc(String b) throws Exception {
        }

        private static String methodd(String b) throws Exception {
            return null;
        }
    }

    private static class ConvertibleTestClass {

        public ConvertibleTestClass() {
        }

        public ConvertibleTestClass(ConvertibleTestClass c) {
        }

        private static ConvertibleObject convertible;

        private static void methoda(ConvertibleObject o) {
        }

        private static ConvertibleObject methodb() {
            return null;
        }
    }

    private static class ConvertibleObject {

        private String content = "content";
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 39 expected expected

SimpleName:IDENTIFIER 39 NoSuchFieldException NoSuchFieldException

SimpleName:IDENTIFIER 40 testFindSuperFieldWronglyTyped testFindSuperFieldWronglyTyped

SimpleName:IDENTIFIER 40 Exception Exception

SimpleName:IDENTIFIER 41 resolver resolver

SimpleName:IDENTIFIER 41 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 41 TestSubClass TestSubClass

SimpleName:IDENTIFIER 42 resolver resolver

SimpleName:IDENTIFIER 42 findField findField

PrimitiveType:KEYWORD 42 boolean boolean

SimpleName:IDENTIFIER 42 Annotation Annotation

@Test(expected = NoSuchFieldException.class)
public void testFindSuperFieldWronglyTyped() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    resolver.findField("st", boolean.class, new Annotation[0]);
}

SimpleName:IDENTIFIER 45 expected expected

SimpleName:IDENTIFIER 45 NoSuchFieldException NoSuchFieldException

SimpleName:IDENTIFIER 46 testFindFieldWronglyTyped testFindFieldWronglyTyped

SimpleName:IDENTIFIER 46 Exception Exception

SimpleName:IDENTIFIER 47 resolver resolver

SimpleName:IDENTIFIER 47 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 47 TestSubClass TestSubClass

SimpleName:IDENTIFIER 48 resolver resolver

SimpleName:IDENTIFIER 48 findField findField

SimpleName:IDENTIFIER 48 Annotation Annotation

@Test(expected = NoSuchFieldException.class)
public void testFindFieldWronglyTyped() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    resolver.findField("bo", String.class, new Annotation[0]);
}


SimpleName:IDENTIFIER 119 expected expected

SimpleName:IDENTIFIER 119 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 120 testCreateMethodInvocatorNonExisting testCreateMethodInvocatorNonExisting

SimpleName:IDENTIFIER 120 Exception Exception

SimpleName:IDENTIFIER 121 resolver resolver

SimpleName:IDENTIFIER 121 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 121 TestSubClass TestSubClass

resolver = new StaticInvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 122 badmethods badmethods

SimpleName:IDENTIFIER 122 BadMethods BadMethods

SimpleName:IDENTIFIER 122 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 123 resolver resolver

SimpleName:IDENTIFIER 123 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 123 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorNonExisting() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[0]);
}

SimpleName:IDENTIFIER 126 expected expected

SimpleName:IDENTIFIER 126 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 127 Exception Exception

SimpleName:IDENTIFIER 128 resolver resolver

SimpleName:IDENTIFIER 128 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 128 TestSubClass TestSubClass

resolver = new StaticInvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 129 badmethods badmethods

SimpleName:IDENTIFIER 129 BadMethods BadMethods

SimpleName:IDENTIFIER 129 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 130 resolver resolver

SimpleName:IDENTIFIER 130 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 130 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglySignature() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[1]);
}

SimpleName:IDENTIFIER 133 expected expected

SimpleName:IDENTIFIER 133 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 134 testCreateMethodInvocatorWronglyTyped testCreateMethodInvocatorWronglyTyped

SimpleName:IDENTIFIER 134 Exception Exception

SimpleName:IDENTIFIER 135 resolver resolver

SimpleName:IDENTIFIER 135 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 135 TestSubClass TestSubClass

resolver = new StaticInvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 136 badmethods badmethods

SimpleName:IDENTIFIER 136 BadMethods BadMethods

SimpleName:IDENTIFIER 136 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 137 resolver resolver

SimpleName:IDENTIFIER 137 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 137 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglyTyped() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[2]);
}

SimpleName:IDENTIFIER 140 expected expected

SimpleName:IDENTIFIER 140 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 141 Exception Exception

SimpleName:IDENTIFIER 142 resolver resolver

SimpleName:IDENTIFIER 142 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 142 TestSubClass TestSubClass

resolver = new StaticInvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 143 badmethods badmethods

SimpleName:IDENTIFIER 143 BadMethods BadMethods

SimpleName:IDENTIFIER 143 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 144 resolver resolver

SimpleName:IDENTIFIER 144 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 144 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglyExceptionTyped() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[3]);
}

SimpleName:IDENTIFIER 147 expected expected

SimpleName:IDENTIFIER 147 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 148 Exception Exception

SimpleName:IDENTIFIER 149 resolver resolver

SimpleName:IDENTIFIER 149 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 149 TestSubClass TestSubClass

resolver = new StaticInvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 150 badmethods badmethods

SimpleName:IDENTIFIER 150 BadMethods BadMethods

SimpleName:IDENTIFIER 150 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 151 resolver resolver

SimpleName:IDENTIFIER 151 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 151 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWronglyExceptionTypedInSuperclass() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[4]);
}

SimpleName:IDENTIFIER 154 expected expected

SimpleName:IDENTIFIER 154 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 155 Exception Exception

SimpleName:IDENTIFIER 156 resolver resolver

SimpleName:IDENTIFIER 156 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 156 TestSubClass TestSubClass

resolver = new StaticInvocationResolver(TestSubClass.class)

SimpleName:IDENTIFIER 157 badmethods badmethods

SimpleName:IDENTIFIER 157 BadMethods BadMethods

SimpleName:IDENTIFIER 157 getDeclaredMethods getDeclaredMethods

Method[] badmethods = BadMethods.class.getDeclaredMethods()

Method[] badmethods = BadMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 158 resolver resolver

SimpleName:IDENTIFIER 158 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 158 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorWrongResultType() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(TestSubClass.class);
    Method[] badmethods = BadMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[5]);
}

SimpleName:IDENTIFIER 161 expected expected

SimpleName:IDENTIFIER 161 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 162 Exception Exception

SimpleName:IDENTIFIER 163 resolver resolver

SimpleName:IDENTIFIER 163 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 163 ConvertibleTestClass ConvertibleTestClass

resolver = new StaticInvocationResolver(ConvertibleTestClass.class)

SimpleName:IDENTIFIER 164 badmethods badmethods

SimpleName:IDENTIFIER 164 NonConvertibleMethods NonConvertibleMethods

SimpleName:IDENTIFIER 164 getDeclaredMethods getDeclaredMethods

Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods()

Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 165 resolver resolver

SimpleName:IDENTIFIER 165 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 165 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorNotConvertibleArguments() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(ConvertibleTestClass.class);
    Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[0]);
}

SimpleName:IDENTIFIER 168 expected expected

SimpleName:IDENTIFIER 168 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 169 Exception Exception

SimpleName:IDENTIFIER 170 resolver resolver

SimpleName:IDENTIFIER 170 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 170 ConvertibleTestClass ConvertibleTestClass

resolver = new StaticInvocationResolver(ConvertibleTestClass.class)

SimpleName:IDENTIFIER 171 badmethods badmethods

SimpleName:IDENTIFIER 171 NonConvertibleMethods NonConvertibleMethods

SimpleName:IDENTIFIER 171 getDeclaredMethods getDeclaredMethods

Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods()

Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 172 resolver resolver

SimpleName:IDENTIFIER 172 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 172 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorNotConvertibleResult() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(ConvertibleTestClass.class);
    Method[] badmethods = NonConvertibleMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[1]);
}

SimpleName:IDENTIFIER 175 expected expected

SimpleName:IDENTIFIER 175 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 176 Exception Exception

SimpleName:IDENTIFIER 177 resolver resolver

SimpleName:IDENTIFIER 177 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 177 ConvertibleTestClass ConvertibleTestClass

resolver = new StaticInvocationResolver(ConvertibleTestClass.class)

SimpleName:IDENTIFIER 178 badmethods badmethods

SimpleName:IDENTIFIER 178 FailedConvertibleMethods FailedConvertibleMethods

SimpleName:IDENTIFIER 178 getDeclaredMethods getDeclaredMethods

Method[] badmethods = FailedConvertibleMethods.class.getDeclaredMethods()

Method[] badmethods = FailedConvertibleMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 179 resolver resolver

SimpleName:IDENTIFIER 179 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 179 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorFailedConvertibleArguments() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(ConvertibleTestClass.class);
    Method[] badmethods = FailedConvertibleMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[0]);
}

SimpleName:IDENTIFIER 182 expected expected

SimpleName:IDENTIFIER 182 NoSuchMethodException NoSuchMethodException

SimpleName:IDENTIFIER 183 Exception Exception

SimpleName:IDENTIFIER 184 resolver resolver

SimpleName:IDENTIFIER 184 StaticInvocationResolver StaticInvocationResolver

SimpleName:IDENTIFIER 184 ConvertibleTestClass ConvertibleTestClass

resolver = new StaticInvocationResolver(ConvertibleTestClass.class)

SimpleName:IDENTIFIER 185 badmethods badmethods

SimpleName:IDENTIFIER 185 FailedConvertibleMethods FailedConvertibleMethods

SimpleName:IDENTIFIER 185 getDeclaredMethods getDeclaredMethods

Method[] badmethods = FailedConvertibleMethods.class.getDeclaredMethods()

Method[] badmethods = FailedConvertibleMethods.class.getDeclaredMethods();

SimpleName:IDENTIFIER 186 resolver resolver

SimpleName:IDENTIFIER 186 createMethodInvocator createMethodInvocator

SimpleName:IDENTIFIER 186 badmethods badmethods

@Test(expected = NoSuchMethodException.class)
public void testCreateMethodInvocatorFailedConvertibleResult() throws Exception {
    StaticInvocationResolver resolver = new StaticInvocationResolver(ConvertibleTestClass.class);
    Method[] badmethods = FailedConvertibleMethods.class.getDeclaredMethods();
    resolver.createMethodInvocator(badmethods[1]);
}


SimpleName:IDENTIFIER 96 testFailsMessageWithNoSayValue testFailsMessageWithNoSayValue

SimpleName:IDENTIFIER 100 message message

StringLiteralExpr:LITERAL 100 "message" "message"

"Missing required property: value of message.say"

@Test
public void testFailsMessageWithNoSayValue() {
    Tropo tropo = new Tropo();
    tropo.message(Key.SAY_OF_MESSAGE(new Say(null)), Key.TO("+13055551212"), Key.NAME("message"));
}

@Test(expected = TropoException.class)
public void testFailsMessageWithNoSayValue() {
    Tropo tropo = new Tropo();
    tropo.message(Key.SAY_OF_MESSAGE(new Say(null)), Key.TO("+13055551212"), Key.NAME("message"));
}

package com.voxeo.tropo;

import static com.voxeo.tropo.Key.ANSWER_ON_MEDIA;
import static com.voxeo.tropo.Key.BARGEIN;
import static com.voxeo.tropo.Key.CHANNEL;
import static com.voxeo.tropo.Key.FROM;
import static com.voxeo.tropo.Key.NETWORK;
import static com.voxeo.tropo.Key.TIMEOUT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.voxeo.tropo.actions.MessageAction.Say;
import com.voxeo.tropo.enums.Channel;
import com.voxeo.tropo.enums.Network;
import com.voxeo.tropo.enums.Voice;

public class adhoc_MessageActionTest {

    @Deprecated
    public void testFailsMessageWithNoNameParameter() {
        Tropo tropo = new Tropo();
        try {
            tropo.message(Key.TO("+13055551212"), Key.SAY_OF_MESSAGE(new Say("This is an announcement")));
            fail("Expected exception in test");
        } catch (TropoException te) {
            assertEquals(te.getMessage(), "Missing required property: 'name'");
        }
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 112 message message

StringLiteralExpr:LITERAL 112 "message" "message"

@Test
public void testFailsMessageWithNoSayValue1() {
    Tropo tropo = new Tropo();
    tropo.message(Key.SAY_OF_MESSAGE(new Say("")), Key.TO("+13055551212"), Key.NAME("message"));
}

@Test(expected = TropoException.class)
public void testFailsMessageWithNoSayValue1() {
    Tropo tropo = new Tropo();
    tropo.message(Key.SAY_OF_MESSAGE(new Say("")), Key.TO("+13055551212"), Key.NAME("message"));
}


SimpleName:IDENTIFIER 63 testFailsRecordWithInvalidSay testFailsRecordWithInvalidSay

StringLiteralExpr:LITERAL 67 "foo" "foo"

"Missing required property: value of record.say"

@Test
public void testFailsRecordWithInvalidSay() {
    Tropo tropo = new Tropo();
    tropo.record(Key.NAME("foo"), Key.URL("http://sendme.com/tropo"), Key.SAY_OF_RECORD(new Say(null)));
}

@Test(expected = TropoException.class)
public void testFailsRecordWithInvalidSay() {
    Tropo tropo = new Tropo();
    tropo.record(Key.NAME("foo"), Key.URL("http://sendme.com/tropo"), Key.SAY_OF_RECORD(new Say(null)));
}

package com.voxeo.tropo;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
import com.voxeo.tropo.actions.Do;
import com.voxeo.tropo.actions.RecordAction;
import com.voxeo.tropo.actions.RecordAction.Say;
import com.voxeo.tropo.actions.RecordAction.Url;
import com.voxeo.tropo.enums.Voice;

public class adhoc_RecordActionTest {

    @Deprecated
    public void testFailsRecordWithNoNameParameter() {
        Tropo tropo = new Tropo();
        try {
            tropo.record(Key.URL("http://sendme.com/tropo"), Key.BEEP(true));
            fail("Expected exception in test");
        } catch (TropoException te) {
            assertEquals(te.getMessage(), "Missing required property: 'name'");
        }
    }
    /*TEST PLACEHOLDER*/
}

StringLiteralExpr:LITERAL 79 "foo" "foo"

@Test
public void testFailsRecordWithInvalidSay1() {
    Tropo tropo = new Tropo();
    tropo.record(Key.NAME("foo"), Key.URL("http://sendme.com/tropo"), Key.SAY_OF_RECORD(new Say("")));
}

@Test(expected = TropoException.class)
public void testFailsRecordWithInvalidSay1() {
    Tropo tropo = new Tropo();
    tropo.record(Key.NAME("foo"), Key.URL("http://sendme.com/tropo"), Key.SAY_OF_RECORD(new Say("")));
}


StringLiteralExpr:LITERAL 91 "foo" "foo"

"For record, the only possible event is 'timeout'."

@Test
public void testFailsRecordWithInvalidSay2() {
    Tropo tropo = new Tropo();
    tropo.record(Key.NAME("foo"), Key.URL("http://sendme.com/tropo"), Key.SAY_OF_RECORD(new Say("Sorry, I did not hear anything. Please call back.", "nomatch:1")));
}

@Test(expected = TropoException.class)
public void testFailsRecordWithInvalidSay2() {
    Tropo tropo = new Tropo();
    tropo.record(Key.NAME("foo"), Key.URL("http://sendme.com/tropo"), Key.SAY_OF_RECORD(new Say("Sorry, I did not hear anything. Please call back.", "nomatch:1")));
}


SimpleName:IDENTIFIER 108 InvalidReaderCallTest InvalidReaderCallTest

SimpleName:IDENTIFIER 110 getPropertyValue getPropertyValue

SimpleName:IDENTIFIER 110 ArrayList ArrayList

StringLiteralExpr:LITERAL 110 "name" "name"

"Reader should have thrown an exception!"

"IllegalArgumentException should be thrown"

"IllegalArgumentException should be thrown instead"

@Test
public void InvalidReaderCallTest() {
    reader.getPropertyValue(new ArrayList<String>(), "name");
}

@Test(expected = InvalidObjectReaderException.class)
public void InvalidReaderCallTest() {
    reader.getPropertyValue(new ArrayList<String>(), "name");
}

package org.geolatte.common.reflection;

import org.geolatte.common.Feature;
import org.geolatte.geom.*;
import org.geolatte.geom.crs.CrsId;
import org.geolatte.geom.jts.JTS;
import org.geolatte.testobjects.TestFeature;
import org.geolatte.testobjects.TestFeatureDoubleShape;
import org.geolatte.testobjects.TestFeatureNoShape;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;

public class adhoc_EntityClassReaderTest {

    private Object testFeature;

    private EntityClassReader reader;

    @Before
    public void setUp() {
        PointSequence pnts = PointCollectionFactory.create(new double[] { 5, 6, 6, 7, 7, 8 }, DimensionalFlag.d2D, CrsId.UNDEFINED);
        LineString shape = new LineString(pnts);
        testFeature = new TestFeature("Antwerpen", 128, new String[] { "Belgium", "Flanders" }, shape, 5, "sub", "subsub");
        reader = EntityClassReader.getClassReaderFor(testFeature.getClass());
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 87 testCreateEnvelope testCreateEnvelope

SimpleName:IDENTIFIER 90 createEnvelope createEnvelope

SimpleName:IDENTIFIER 91 assertEquals assertEquals

SimpleName:IDENTIFIER 91 getMinX getMinX

SimpleName:IDENTIFIER 92 assertEquals assertEquals

SimpleName:IDENTIFIER 92 getMinY getMinY

SimpleName:IDENTIFIER 93 assertEquals assertEquals

SimpleName:IDENTIFIER 93 getMaxX getMaxX

SimpleName:IDENTIFIER 94 assertEquals assertEquals

SimpleName:IDENTIFIER 94 getMaxY getMaxY

SimpleName:IDENTIFIER 95 TypeConversionException TypeConversionException

StringLiteralExpr:LITERAL
96
"No exception expected"
"No exception expected"

SimpleName:IDENTIFIER 108 createEnvelope createEnvelope

@Test
public void testCreateEnvelope() {
    try {
        Envelope en = ec.createEnvelope(new double[] { 10.0, 11.0, 5.0, 28.0 });
        Assert.assertEquals(5, en.getMinX(), 0.001);
        Assert.assertEquals(11, en.getMinY(), 0.001);
        Assert.assertEquals(10, en.getMaxX(), 0.001);
        Assert.assertEquals(28, en.getMaxY(), 0.001);
    } catch (TypeConversionException e) {
        Assert.fail("No exception expected");
    }
    Envelope en = ec.createEnvelope(new double[] { 10.0, 11.0 });
}

@Test(expected = TypeConversionException.class)
public void testCreateEnvelope() {
    try {
        Envelope en = ec.createEnvelope(new double[] { 10.0, 11.0, 5.0, 28.0 });
        Assert.assertEquals(5, en.getMinX(), 0.001);
        Assert.assertEquals(11, en.getMinY(), 0.001);
        Assert.assertEquals(10, en.getMaxX(), 0.001);
        Assert.assertEquals(28, en.getMaxY(), 0.001);
    } catch (TypeConversionException e) {
        Assert.fail("No exception expected");
    }
    Envelope en = ec.createEnvelope(new double[] { 10.0, 11.0 });
}

package org.geolatte.common.geo;

import org.geolatte.geom.Envelope;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class adhoc_EnvelopeConverterTest {

    private EnvelopeConverter ec;

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


SimpleName:IDENTIFIER 82 TransformerChainFactory TransformerChainFactory

SimpleName:IDENTIFIER 82 Integer Integer

SimpleName:IDENTIFIER 82 newChain newChain

SimpleName:IDENTIFIER 82 Transformer Transformer

@Test
public void test_CompositionErrors() {
    TransformerChainFactory.<Double, Integer>newChain().add((Transformer<Double, Object>) null);
}

@Test(expected = IllegalArgumentException.class)
public void test_CompositionErrors() {
    TransformerChainFactory.<Double, Integer>newChain().add((Transformer<Double, Object>) null);
}

package org.geolatte.common.transformer;

import org.geolatte.common.transformer.testutil.LoggingTransformerEventListener;
import org.geolatte.common.transformer.testutil.LoggingTransformerSourceEventListener;
import org.geolatte.testobjects.*;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;

public class adhoc_TransformerChainFactoryTest {

    private Transformation<Double, String> numberTransformation;

    private Transformation<String, String> capitalizeTransformation;

    private Transformation<String, Integer> countTransformation;

    private Transformer<Double, String> numberTransformer;

    private Transformer<String, String> capitalizeTransformer;

    private Transformer<String, Integer> countTransformer;

    @Before
    public void setUp() throws Exception {
        numberTransformation = new CharacterNumberTransformation();
        capitalizeTransformation = new CapitalizeTransformation();
        countTransformation = new CharacterCountTransformation();
        numberTransformer = new DefaultTransformer<Double, String>(numberTransformation);
        capitalizeTransformer = new DefaultTransformer<String, String>(capitalizeTransformation);
        countTransformer = new DefaultTransformer<String, Integer>(countTransformation);
    }

    @After
    public void tearDown() throws Exception {
    }
    /*TEST PLACEHOLDER*/
}

Verifies whether a transformer chain cannot be constructed with 'null' transformers.


SimpleName:IDENTIFIER 87 expected expected

SimpleName:IDENTIFIER 87 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 90 ArrayList ArrayList

StringLiteralExpr:LITERAL 90 "Scarlett" "Scarlett"

StringLiteralExpr:LITERAL 90 "Natalie" "Natalie"

StringLiteralExpr:LITERAL 90 "Rachel" "Rachel"

StringLiteralExpr:LITERAL 90 "Cameron" "Cameron"

SimpleName:IDENTIFIER 92 IterableTransformerSink IterableTransformerSink

SimpleName:IDENTIFIER 93 setInput setInput

SimpleName:IDENTIFIER 95 iterator iterator

SimpleName:IDENTIFIER 96 iterator iterator

SimpleName:IDENTIFIER 97 iterator iterator

@Test(expected = UnsupportedOperationException.class)
public void check_IteratorRemoveDisabled() {
    ArrayList<String> input = new ArrayList<String>(Arrays.asList(new String[] { "Scarlett", "Natalie", "Rachel", "Cameron" }));
    IterableTransformerSink<String> sink = new IterableTransformerSink<String>();
    sink.setInput(input);
    Iterator iterator = sink.iterator();
    iterator.next();
    iterator.remove();
}

package org.geolatte.common.transformer;

import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

public class adhoc_IterableTransformerSinkTest {
    /*TEST PLACEHOLDER*/
}

Verifies that the remove() method of the iterator does nothing.


SimpleName:IDENTIFIER 180 expected expected

SimpleName:IDENTIFIER 180 UnsupportedOperationException UnsupportedOperationException

SimpleName:IDENTIFIER 183 ArrayList ArrayList

StringLiteralExpr:LITERAL 183 "Scarlett" "Scarlett"

StringLiteralExpr:LITERAL 183 "Natalie" "Natalie"

StringLiteralExpr:LITERAL 183 "Rachel" "Rachel"

StringLiteralExpr:LITERAL 183 "Cameron" "Cameron"

SimpleName:IDENTIFIER 185 transformer transformer

SimpleName:IDENTIFIER 185 DefaultTransformer DefaultTransformer

SimpleName:IDENTIFIER 185 Integer Integer

SimpleName:IDENTIFIER 185 CharacterCountTransformation CharacterCountTransformation

SimpleName:IDENTIFIER 187 transformer transformer

SimpleName:IDENTIFIER 187 setInput setInput

SimpleName:IDENTIFIER 189 iterator iterator

SimpleName:IDENTIFIER 189 transformer transformer

SimpleName:IDENTIFIER 190 iterator iterator

SimpleName:IDENTIFIER 191 iterator iterator

@Test(expected = UnsupportedOperationException.class)
public void test_RemoveFromOutput() {
    ArrayList<String> input = new ArrayList<String>(Arrays.asList(new String[] { "Scarlett", "Natalie", "Rachel", "Cameron" }));
    DefaultTransformer<String, Integer> transformer = new DefaultTransformer<String, Integer>(new CharacterCountTransformation());
    transformer.setInput(input);
    Iterator iterator = transformer.output().iterator();
    iterator.next();
    iterator.remove();
}

package org.geolatte.common.transformer;

import org.geolatte.common.transformer.testutil.LoggingTransformerEventListener;
import org.geolatte.testobjects.CharacterCountTransformation;
import org.geolatte.testobjects.ExceptionThrowingTransformation;
import org.geolatte.testobjects.SpellWordTransformation;
import org.junit.Assert;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

public class adhoc_DefaultTransformerTest {
    /*TEST PLACEHOLDER*/
}

Tests whether removing an element from the ouput iterable is impossible.


SimpleName:IDENTIFIER 50 expected expected

SimpleName:IDENTIFIER 50 ClosedJournalException ClosedJournalException

SimpleName:IDENTIFIER 51 testCompactingFailsAfterClose testCompactingFailsAfterClose

SimpleName:IDENTIFIER 51 Exception Exception

SimpleName:IDENTIFIER 52 journal journal

SimpleName:IDENTIFIER 53 journal journal

SimpleName:IDENTIFIER 53 compact compact

{
    journal.close();
    journal.compact();
}

@Test(expected = ClosedJournalException.class)
public void testCompactingFailsAfterClose() throws Exception {
    journal.close();
    journal.compact();
}

{
    journal.close();
    journal.compact();
}

package journal.io.api;

import java.io.File;
import java.io.IOException;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_LifeCycleTest extends AbstractJournalTest {
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 56 expected expected

SimpleName:IDENTIFIER 56 IOException IOException

SimpleName:IDENTIFIER 57 testOpenFailsWithInvalidDirectory testOpenFailsWithInvalidDirectory

SimpleName:IDENTIFIER 57 IOException IOException

StringLiteralExpr:LITERAL 58 "non-existing" "non-existing"

SimpleName:IDENTIFIER 59 badJournal badJournal

SimpleName:IDENTIFIER 59 Journal Journal

SimpleName:IDENTIFIER 60 badJournal badJournal

SimpleName:IDENTIFIER 60 setDirectory setDirectory

SimpleName:IDENTIFIER 62 badJournal badJournal

StringLiteralExpr:LITERAL
63
"Should file if dir does not exist!"
"Should file if dir does not exist!"

SimpleName:IDENTIFIER 65 badJournal badJournal

@Test(expected = IOException.class)
public void testOpenFailsWithInvalidDirectory() throws IOException {
    File badDir = new File("non-existing");
    Journal badJournal = new Journal();
    badJournal.setDirectory(badDir);
    try {
        badJournal.open();
        fail("Should file if dir does not exist!");
    } finally {
        badJournal.close();
    }
}


SimpleName:IDENTIFIER 62 expected expected

SimpleName:IDENTIFIER 62 OpenJournalException OpenJournalException

SimpleName:IDENTIFIER 63 testCannotTruncateOpenJournal testCannotTruncateOpenJournal

SimpleName:IDENTIFIER 63 Exception Exception

SimpleName:IDENTIFIER 64 journal journal

SimpleName:IDENTIFIER 64 truncate truncate

@Test(expected = OpenJournalException.class)
public void testCannotTruncateOpenJournal() throws Exception {
    journal.truncate();
}

package journal.io.api;

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

public class adhoc_TruncateTest extends AbstractJournalTest {

    @Override
    protected boolean configure(Journal journal) {
        journal.setMaxFileLength(1024);
        journal.setMaxWriteBatchSize(500);
        return true;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 124 expected expected

SimpleName:IDENTIFIER 124 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 125 Exception Exception

SimpleName:IDENTIFIER 126 journal journal

SimpleName:IDENTIFIER 126 getBytes getBytes

SimpleName:IDENTIFIER 126 Journal Journal

SimpleName:IDENTIFIER 126 WriteType WriteType

SimpleName:IDENTIFIER 127 journal journal

SimpleName:IDENTIFIER 127 iterator iterator

SimpleName:IDENTIFIER 128 assertTrue assertTrue

SimpleName:IDENTIFIER 128 hasNext hasNext

SimpleName:IDENTIFIER 130 assertFalse assertFalse

SimpleName:IDENTIFIER 130 hasNext hasNext

@Test(expected = NoSuchElementException.class)
public void testNoSuchElementExceptionWithRedoIterator() throws Exception {
    journal.write("A".getBytes("UTF-8"), Journal.WriteType.ASYNC);
    Iterator<Location> itr = journal.redo().iterator();
    assertTrue(itr.hasNext());
    itr.next();
    assertFalse(itr.hasNext());
    itr.next();
}

package journal.io.api;

import java.util.Iterator;
import java.util.NoSuchElementException;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_RedoUndoTest extends AbstractJournalTest {

    @Override
    protected boolean configure(Journal journal) {
        journal.setMaxFileLength(1024 * 100);
        journal.setMaxWriteBatchSize(1024);
        return true;
    }
    /*TEST PLACEHOLDER*/
}


SimpleName:IDENTIFIER 231 expected expected

SimpleName:IDENTIFIER 231 NoSuchElementException NoSuchElementException

SimpleName:IDENTIFIER 232 Exception Exception

SimpleName:IDENTIFIER 233 journal journal

SimpleName:IDENTIFIER 233 getBytes getBytes

SimpleName:IDENTIFIER 233 Journal Journal

SimpleName:IDENTIFIER 233 WriteType WriteType

SimpleName:IDENTIFIER 234 journal journal

SimpleName:IDENTIFIER 234 iterator iterator

SimpleName:IDENTIFIER 235 assertTrue assertTrue

SimpleName:IDENTIFIER 235 hasNext hasNext

SimpleName:IDENTIFIER 237 assertFalse assertFalse

SimpleName:IDENTIFIER 237 hasNext hasNext

@Test(expected = NoSuchElementException.class)
public void testNoSuchElementExceptionWithUndoIterator() throws Exception {
    journal.write("A".getBytes("UTF-8"), Journal.WriteType.ASYNC);
    Iterator<Location> itr = journal.undo().iterator();
    assertTrue(itr.hasNext());
    itr.next();
    assertFalse(itr.hasNext());
    itr.next();
}


SimpleName:IDENTIFIER 589 expected expected

SimpleName:IDENTIFIER 589 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 589 testVertexSetIteratorRemoveTwice testVertexSetIteratorRemoveTwice

SimpleName:IDENTIFIER 590 SparseDirectedGraph SparseDirectedGraph

SimpleName:IDENTIFIER 591 control control

SimpleName:IDENTIFIER 591 HashSet HashSet

SimpleName:IDENTIFIER 591 Integer Integer

Set<Integer> control = new HashSet<Integer>()

Set<Integer> control = new HashSet<Integer>();

SimpleName:IDENTIFIER 594 control control

SimpleName:IDENTIFIER 597 vertices vertices

SimpleName:IDENTIFIER 598 vertices vertices

SimpleName:IDENTIFIER 598 iterator iterator

Iterator<Integer> iter = vertices.iterator()

Iterator<Integer> iter = vertices.iterator();

SimpleName:IDENTIFIER 599 assertTrue assertTrue

SimpleName:IDENTIFIER 599 hasNext hasNext

SimpleName:IDENTIFIER 600 toRemove toRemove

SimpleName:IDENTIFIER 601 assertTrue assertTrue

SimpleName:IDENTIFIER 601 contains contains

SimpleName:IDENTIFIER 601 toRemove toRemove

SimpleName:IDENTIFIER 602 assertTrue assertTrue

SimpleName:IDENTIFIER 602 vertices vertices

SimpleName:IDENTIFIER 602 contains contains

SimpleName:IDENTIFIER 602 toRemove toRemove

@Test(expected = IllegalStateException.class)
public void testVertexSetIteratorRemoveTwice() {
    Graph<DirectedEdge> g = new SparseDirectedGraph();
    Set<Integer> control = new HashSet<Integer>();
    for (int i = 0; i < 100; ++i) {
        g.add(i);
        control.add(i);
    }
    Set<Integer> vertices = g.vertices();
    Iterator<Integer> iter = vertices.iterator();
    assertTrue(iter.hasNext());
    Integer toRemove = iter.next();
    assertTrue(g.contains(toRemove));
    assertTrue(vertices.contains(toRemove));
    iter.remove();
    iter.remove();
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SparseDirectedGraphTests {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 607 expected expected

SimpleName:IDENTIFIER 607 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 607 testVertexSetIteratorRemoveEarly testVertexSetIteratorRemoveEarly

SimpleName:IDENTIFIER 608 SparseDirectedGraph SparseDirectedGraph

SimpleName:IDENTIFIER 609 control control

SimpleName:IDENTIFIER 609 HashSet HashSet

SimpleName:IDENTIFIER 609 Integer Integer

Set<Integer> control = new HashSet<Integer>()

Set<Integer> control = new HashSet<Integer>();

SimpleName:IDENTIFIER 612 control control

SimpleName:IDENTIFIER 615 vertices vertices

SimpleName:IDENTIFIER 616 vertices vertices

SimpleName:IDENTIFIER 616 iterator iterator

Iterator<Integer> iter = vertices.iterator()

Iterator<Integer> iter = vertices.iterator();

@Test(expected = IllegalStateException.class)
public void testVertexSetIteratorRemoveEarly() {
    Graph<DirectedEdge> g = new SparseDirectedGraph();
    Set<Integer> control = new HashSet<Integer>();
    for (int i = 0; i < 100; ++i) {
        g.add(i);
        control.add(i);
    }
    Set<Integer> vertices = g.vertices();
    Iterator<Integer> iter = vertices.iterator();
    iter.remove();
}

SimpleName:IDENTIFIER 561 expected expected

SimpleName:IDENTIFIER 561 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 561 testVertexSetIteratorRemoveTwice testVertexSetIteratorRemoveTwice

SimpleName:IDENTIFIER 562 SparseWeightedGraph SparseWeightedGraph

SimpleName:IDENTIFIER 563 control control

SimpleName:IDENTIFIER 563 HashSet HashSet

SimpleName:IDENTIFIER 563 Integer Integer

Set<Integer> control = new HashSet<Integer>()

Set<Integer> control = new HashSet<Integer>();

SimpleName:IDENTIFIER 566 control control

SimpleName:IDENTIFIER 569 vertices vertices

SimpleName:IDENTIFIER 570 vertices vertices

SimpleName:IDENTIFIER 570 iterator iterator

Iterator<Integer> iter = vertices.iterator()

Iterator<Integer> iter = vertices.iterator();

SimpleName:IDENTIFIER 571 assertTrue assertTrue

SimpleName:IDENTIFIER 571 hasNext hasNext

SimpleName:IDENTIFIER 572 toRemove toRemove

SimpleName:IDENTIFIER 573 assertTrue assertTrue

SimpleName:IDENTIFIER 573 contains contains

SimpleName:IDENTIFIER 573 toRemove toRemove

SimpleName:IDENTIFIER 574 assertTrue assertTrue

SimpleName:IDENTIFIER 574 vertices vertices

SimpleName:IDENTIFIER 574 contains contains

SimpleName:IDENTIFIER 574 toRemove toRemove

@Test(expected = IllegalStateException.class)
public void testVertexSetIteratorRemoveTwice() {
    Graph<WeightedEdge> g = new SparseWeightedGraph();
    Set<Integer> control = new HashSet<Integer>();
    for (int i = 0; i < 100; ++i) {
        g.add(i);
        control.add(i);
    }
    Set<Integer> vertices = g.vertices();
    Iterator<Integer> iter = vertices.iterator();
    assertTrue(iter.hasNext());
    Integer toRemove = iter.next();
    assertTrue(g.contains(toRemove));
    assertTrue(vertices.contains(toRemove));
    iter.remove();
    iter.remove();
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SparseWeightedGraphTests {
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 579 expected expected

SimpleName:IDENTIFIER 579 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 579 testVertexSetIteratorRemoveEarly testVertexSetIteratorRemoveEarly

SimpleName:IDENTIFIER 580 SparseWeightedGraph SparseWeightedGraph

SimpleName:IDENTIFIER 581 control control

SimpleName:IDENTIFIER 581 HashSet HashSet

SimpleName:IDENTIFIER 581 Integer Integer

Set<Integer> control = new HashSet<Integer>()

Set<Integer> control = new HashSet<Integer>();

SimpleName:IDENTIFIER 584 control control

SimpleName:IDENTIFIER 587 vertices vertices

SimpleName:IDENTIFIER 588 vertices vertices

SimpleName:IDENTIFIER 588 iterator iterator

Iterator<Integer> iter = vertices.iterator()

Iterator<Integer> iter = vertices.iterator();

@Test(expected = IllegalStateException.class)
public void testVertexSetIteratorRemoveEarly() {
    Graph<WeightedEdge> g = new SparseWeightedGraph();
    Set<Integer> control = new HashSet<Integer>();
    for (int i = 0; i < 100; ++i) {
        g.add(i);
        control.add(i);
    }
    Set<Integer> vertices = g.vertices();
    Iterator<Integer> iter = vertices.iterator();
    iter.remove();
}

SimpleName:IDENTIFIER 510 expected expected

SimpleName:IDENTIFIER 510 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 510 testVertexSetIteratorRemoveTwice testVertexSetIteratorRemoveTwice

SimpleName:IDENTIFIER 511 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 512 control control

SimpleName:IDENTIFIER 512 HashSet HashSet

SimpleName:IDENTIFIER 512 Integer Integer

Set<Integer> control = new HashSet<Integer>()

Set<Integer> control = new HashSet<Integer>();

SimpleName:IDENTIFIER 515 control control

SimpleName:IDENTIFIER 518 vertices vertices

SimpleName:IDENTIFIER 519 vertices vertices

SimpleName:IDENTIFIER 519 iterator iterator

Iterator<Integer> iter = vertices.iterator()

Iterator<Integer> iter = vertices.iterator();

SimpleName:IDENTIFIER 520 assertTrue assertTrue

SimpleName:IDENTIFIER 520 hasNext hasNext

SimpleName:IDENTIFIER 521 toRemove toRemove

SimpleName:IDENTIFIER 522 assertTrue assertTrue

SimpleName:IDENTIFIER 522 contains contains

SimpleName:IDENTIFIER 522 toRemove toRemove

SimpleName:IDENTIFIER 523 assertTrue assertTrue

SimpleName:IDENTIFIER 523 vertices vertices

SimpleName:IDENTIFIER 523 contains contains

SimpleName:IDENTIFIER 523 toRemove toRemove

@Test(expected = IllegalStateException.class)
public void testVertexSetIteratorRemoveTwice() {
    Graph<Edge> g = new SparseUndirectedGraph();
    Set<Integer> control = new HashSet<Integer>();
    for (int i = 0; i < 100; ++i) {
        g.add(i);
        control.add(i);
    }
    Set<Integer> vertices = g.vertices();
    Iterator<Integer> iter = vertices.iterator();
    assertTrue(iter.hasNext());
    Integer toRemove = iter.next();
    assertTrue(g.contains(toRemove));
    assertTrue(vertices.contains(toRemove));
    iter.remove();
    iter.remove();
}

package edu.ucla.sspace.graph;

import java.util.*;
import edu.ucla.sspace.util.OpenIntSet;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.*;

public class adhoc_SparseUndirectedGraphTests {

    public void testSubgraphWhenVerticesRemovedFromBacking() {
        Graph<Edge> g = new SparseUndirectedGraph();
        for (int i = 0; i < 10; i++) {
            for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
        }
        assertEquals((10 * 9) / 2, g.size());
        assertEquals(10, g.order());
        Set<Integer> vertices = new LinkedHashSet<Integer>();
        for (int i = 0; i < 5; ++i) vertices.add(i);
        Graph<Edge> subgraph = g.subgraph(vertices);
        g.remove(0);
        assertEquals(4, subgraph.order());
        assertEquals((3 * 4) / 2, subgraph.size());
        g.remove(1);
        assertFalse(subgraph.contains(1));
        g.remove(2);
        assertFalse(subgraph.contains(new SimpleEdge(2, 3)));
    }

    public void testSubgraphVertexIteratorWhenVerticesRemovedFromBacking() {
        Graph<Edge> g = new SparseUndirectedGraph();
        for (int i = 0; i < 10; i++) {
            for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
        }
        assertEquals((10 * 9) / 2, g.size());
        assertEquals(10, g.order());
        Set<Integer> vertices = new LinkedHashSet<Integer>();
        for (int i = 0; i < 5; ++i) vertices.add(i);
        Graph<Edge> subgraph = g.subgraph(vertices);
        Iterator<Integer> it = subgraph.vertices().iterator();
        g.remove(0);
        int i = 0;
        while (it.hasNext()) assertTrue(0 != it.next());
        assertEquals(4, i);
    }

    public void testSubgraphEdgesWhenVerticesRemovedFromBacking() {
        Graph<Edge> g = new SparseUndirectedGraph();
        for (int i = 0; i < 10; i++) {
            for (int j = i + 1; j < 10; ++j) g.add(new SimpleEdge(i, j));
        }
        assertEquals((10 * 9) / 2, g.size());
        assertEquals(10, g.order());
        Set<Integer> vertices = new LinkedHashSet<Integer>();
        for (int i = 0; i < 5; ++i) vertices.add(i);
        Graph<Edge> subgraph = g.subgraph(vertices);
        Set<Edge> edges = subgraph.edges();
        g.remove(0);
        assertEquals((4 * 3) / 2, edges.size());
        assertFalse(edges.contains(new SimpleEdge(0, 1)));
    }
    /*TEST PLACEHOLDER*/
}

SimpleName:IDENTIFIER 528 expected expected

SimpleName:IDENTIFIER 528 IllegalStateException IllegalStateException

SimpleName:IDENTIFIER 528 testVertexSetIteratorRemoveEarly testVertexSetIteratorRemoveEarly

SimpleName:IDENTIFIER 529 SparseUndirectedGraph SparseUndirectedGraph

Graph<Edge> g = new SparseUndirectedGraph()

Graph<Edge> g = new SparseUndirectedGraph();

SimpleName:IDENTIFIER 530 control control

SimpleName:IDENTIFIER 530 HashSet HashSet

SimpleName:IDENTIFIER 530 Integer Integer

Set<Integer> control = new HashSet<Integer>()

Set<Integer> control = new HashSet<Integer>();

SimpleName:IDENTIFIER 533 control control

SimpleName:IDENTIFIER 536 vertices vertices

SimpleName:IDENTIFIER 537 vertices vertices

SimpleName:IDENTIFIER 537 iterator iterator

Iterator<Integer> iter = vertices.iterator()

Iterator<Integer> iter = vertices.iterator();

@Test(expected = IllegalStateException.class)
public void testVertexSetIteratorRemoveEarly() {
    Graph<Edge> g = new SparseUndirectedGraph();
    Set<Integer> control = new HashSet<Integer>();
    for (int i = 0; i < 100; ++i) {
        g.add(i);
        control.add(i);
    }
    Set<Integer> vertices = g.vertices();
    Iterator<Integer> iter = vertices.iterator();
    iter.remove();
}