Search in sources :

Example 6 with TypedJson

use of org.apache.geode.management.internal.cli.json.TypedJson in project geode by apache.

the class TypedJsonJUnitTest method testEnumList.

@Test
public void testEnumList() {
    List ls = new ArrayList();
    ls.add(Currency.DIME);
    ls.add(Currency.NICKLE);
    ls.add(Currency.QUARTER);
    ls.add(Currency.NICKLE);
    TypedJson tjson = new TypedJson(RESULT, ls);
    System.out.println(tjson);
}
Also used : TypedJson(org.apache.geode.management.internal.cli.json.TypedJson) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 7 with TypedJson

use of org.apache.geode.management.internal.cli.json.TypedJson in project geode by apache.

the class TypedJsonJUnitTest method testBigDecimal.

@Test
public void testBigDecimal() {
    java.math.BigDecimal dc = new java.math.BigDecimal(20);
    TypedJson tjson = new TypedJson(RESULT, dc);
    System.out.println(tjson);
}
Also used : TypedJson(org.apache.geode.management.internal.cli.json.TypedJson) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 8 with TypedJson

use of org.apache.geode.management.internal.cli.json.TypedJson in project geode by apache.

the class TypedJsonJUnitTest method testEnum.

@Test
public void testEnum() {
    EnumContainer test = new EnumContainer(Currency.DIME);
    TypedJson tjson = new TypedJson(RESULT, test);
    checkResult(tjson);
    TypedJson enumObj = new TypedJson(RESULT, Currency.DIME);
    checkResult(enumObj);
}
Also used : TypedJson(org.apache.geode.management.internal.cli.json.TypedJson) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 9 with TypedJson

use of org.apache.geode.management.internal.cli.json.TypedJson in project geode by apache.

the class TypedJsonJUnitTest method testQueryLike.

@Test
public void testQueryLike() {
    Portfolio[] p = createPortfoliosAndPositions(2);
    TypedJson t1 = new TypedJson(RESULT, null);
    t1.add("member", "server1");
    System.out.println(t1);
    for (int i = 0; i < 2; i++) {
        t1.add(RESULT, p[i]);
    }
    System.out.println(t1);
}
Also used : Portfolio(org.apache.geode.cache.query.data.Portfolio) TypedJson(org.apache.geode.management.internal.cli.json.TypedJson) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 10 with TypedJson

use of org.apache.geode.management.internal.cli.json.TypedJson in project geode by apache.

the class TypedJsonJUnitTest method testObjects.

@Test
public void testObjects() {
    Object obj = new Object();
    TypedJson tjson = new TypedJson(RESULT, obj);
    System.out.println(tjson);
}
Also used : TypedJson(org.apache.geode.management.internal.cli.json.TypedJson) GfJsonObject(org.apache.geode.management.internal.cli.json.GfJsonObject) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Aggregations

TypedJson (org.apache.geode.management.internal.cli.json.TypedJson)15 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)14 Test (org.junit.Test)14 Portfolio (org.apache.geode.cache.query.data.Portfolio)5 Cache (org.apache.geode.cache.Cache)2 CacheFactory (org.apache.geode.cache.CacheFactory)2 GfJsonObject (org.apache.geode.management.internal.cli.json.GfJsonObject)2 PdxInstance (org.apache.geode.pdx.PdxInstance)2 PdxInstanceFactory (org.apache.geode.pdx.PdxInstanceFactory)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Region (org.apache.geode.cache.Region)1 Function (org.apache.geode.cache.execute.Function)1 FunctionException (org.apache.geode.cache.execute.FunctionException)1 ResultCollector (org.apache.geode.cache.execute.ResultCollector)1 Query (org.apache.geode.cache.query.Query)1 QueryInvalidException (org.apache.geode.cache.query.QueryInvalidException)1 QueryService (org.apache.geode.cache.query.QueryService)1 SelectResults (org.apache.geode.cache.query.SelectResults)1 DefaultQuery (org.apache.geode.cache.query.internal.DefaultQuery)1