Search in sources :

Example 21 with DataProvider

use of org.testng.annotations.DataProvider in project rest.li by linkedin.

the class TestClientBuilders method getAll1.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "getAll1")
public Object[][] getAll1() {
    //Sample URIs:
    //"test?count=4&fields=message,id&start=1"
    //"test?count=4&fields=message,id&start=1"
    final Set<String> fieldSet = new HashSet<String>();
    fieldSet.add("message");
    fieldSet.add("id");
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("count", "4");
    queryParamsMap.put("start", "1");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", null, queryParamsMap, fieldSet);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", null, queryParamsMap, fieldSet);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) HashSet(java.util.HashSet) DataProvider(org.testng.annotations.DataProvider)

Example 22 with DataProvider

use of org.testng.annotations.DataProvider in project rest.li by linkedin.

the class TestClientBuilders method search2.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "search2")
public Object[][] search2() {
    //Sample URIs:
    //"test/key=a%3Ab?p=42&q=search&start=1"
    //"test/(key:a%3Ab)?p=42&q=search&start=1"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("p", "42");
    queryParamsMap.put("q", "search");
    queryParamsMap.put("start", "1");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/key=a%3Ab", null, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/(key:a%3Ab)", null, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) DataProvider(org.testng.annotations.DataProvider)

Example 23 with DataProvider

use of org.testng.annotations.DataProvider in project rest.li by linkedin.

the class TestClientBuilders method batchComplexKeyAndParam.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "batchComplexKeyAndParam")
public Object[][] batchComplexKeyAndParam() {
    //Sample valid URIs:
    //"test?ids%5B0%5D.$params.id=20&ids%5B0%5D.$params.message=ParamMessage2&ids%5B0%5D.id=2&ids%5B0%5D.message=KeyMessage2&ids%5B1%5D.$params.id=10&ids%5B1%5D.$params.message=ParamMessage1&ids%5B1%5D.id=1&ids%5B1%5D.message=KeyMessage1&testParam.id=123&testParam.message=ParamMessage"
    //"test?ids=List(($params:(id:20,message:ParamMessage2),id:2,message:KeyMessage2),($params:(id:10,message:ParamMessage1),id:1,message:KeyMessage1))&testParam=(id:123,message:ParamMessage)"
    final DataMap idMessageMap = new DataMap();
    idMessageMap.put("id", "123");
    idMessageMap.put("message", "ParamMessage");
    final Map<String, DataComplex> queryParamsMap = new HashMap<String, DataComplex>();
    queryParamsMap.put("testParam", idMessageMap);
    final Set<DataMap> idList = new HashSet<DataMap>();
    final DataMap idMapOne = new DataMap();
    idMapOne.put("id", "1");
    idMapOne.put("message", "KeyMessage1");
    final DataMap paramMapOne = new DataMap();
    paramMapOne.put("id", "10");
    paramMapOne.put("message", "ParamMessage1");
    idMapOne.put("$params", paramMapOne);
    final DataMap idMapTwo = new DataMap();
    idMapTwo.put("id", "2");
    idMapTwo.put("message", "KeyMessage2");
    final DataMap paramMapTwo = new DataMap();
    paramMapTwo.put("id", "20");
    paramMapTwo.put("message", "ParamMessage2");
    idMapTwo.put("$params", paramMapTwo);
    idList.add(idMapOne);
    idList.add(idMapTwo);
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test", idList, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test", idList, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : DataComplex(com.linkedin.data.DataComplex) URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) DataMap(com.linkedin.data.DataMap) HashSet(java.util.HashSet) DataProvider(org.testng.annotations.DataProvider)

Example 24 with DataProvider

use of org.testng.annotations.DataProvider in project rest.li by linkedin.

the class TestClientBuilders method complexKeyAndParam.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "complexKeyAndParam")
public Object[][] complexKeyAndParam() {
    //Sample URIs:
    //"test/$params.id=10&$params.message=ParamMessage&id=1&message=KeyMessage?testParam.id=123&testParam.message=ParamMessage"
    //"test/($params:(id:10,message:ParamMessage),id:1,message:KeyMessage)?testParam=(id:123,message:ParamMessage)"
    final DataMap idMessageMap = new DataMap();
    idMessageMap.put("id", "123");
    idMessageMap.put("message", "ParamMessage");
    final Map<String, DataComplex> queryParamsMap = new HashMap<String, DataComplex>();
    queryParamsMap.put("testParam", idMessageMap);
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/$params.id=10&$params.message=ParamMessage&id=1&message=KeyMessage", null, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/($params:(id:10,message:ParamMessage),id:1,message:KeyMessage)", null, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : DataComplex(com.linkedin.data.DataComplex) URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) DataMap(com.linkedin.data.DataMap) DataProvider(org.testng.annotations.DataProvider)

Example 25 with DataProvider

use of org.testng.annotations.DataProvider in project rest.li by linkedin.

the class TestClientBuilders method entityWithParam.

@DataProvider(name = TestConstants.RESTLI_PROTOCOL_1_2_PREFIX + "entityWithParam")
public Object[][] entityWithParam() {
    //Sample URIs"
    //"test/3?foo=bar"
    //"test/3?foo=bar"
    final Map<String, String> queryParamsMap = new HashMap<String, String>();
    queryParamsMap.put("foo", "bar");
    final URIDetails uriDetails1 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_1_0_0.getProtocolVersion(), "test/3", null, queryParamsMap, null);
    final URIDetails uriDetails2 = new URIDetails(AllProtocolVersions.RESTLI_PROTOCOL_2_0_0.getProtocolVersion(), "test/3", null, queryParamsMap, null);
    return new Object[][] { { uriDetails1 }, { uriDetails2 } };
}
Also used : URIDetails(com.linkedin.restli.internal.testutils.URIDetails) HashMap(java.util.HashMap) ByteString(com.linkedin.data.ByteString) DataProvider(org.testng.annotations.DataProvider)

Aggregations

DataProvider (org.testng.annotations.DataProvider)387 SimpleInterval (org.broadinstitute.hellbender.utils.SimpleInterval)99 ArrayList (java.util.ArrayList)92 Test (org.testng.annotations.Test)85 File (java.io.File)74 List (java.util.List)72 Assert (org.testng.Assert)67 URIDetails (com.linkedin.restli.internal.testutils.URIDetails)65 Collectors (java.util.stream.Collectors)61 HashMap (java.util.HashMap)57 IntStream (java.util.stream.IntStream)54 Random (java.util.Random)50 RealMatrix (org.apache.commons.math3.linear.RealMatrix)44 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)41 IOException (java.io.IOException)39 ByteString (com.linkedin.data.ByteString)37 Array2DRowRealMatrix (org.apache.commons.math3.linear.Array2DRowRealMatrix)34 Stream (java.util.stream.Stream)31 DoubleStream (java.util.stream.DoubleStream)29 HashSet (java.util.HashSet)28