Package org.socialmusicdiscovery.server.business.model.classification

Examples of org.socialmusicdiscovery.server.business.model.classification.Classification


        assert result.getLong("totalSize") == 17;
        JSONArray resultItems = result.getJSONArray("items");

        for (int i = 0; i < resultItems.length(); i++) {
            JSONObject item = ((JSONObject) resultItems.get(i)).getJSONObject("item");
            Classification classification = jsonProvider.fromJson(item.toString(), Classification.class);
            assert classification != null;
            assert classification.getName() != null;
            JSONArray childItems = ((JSONObject) resultItems.get(i)).optJSONArray("childItems");
            assert childItems == null;
        }

        result = Client.create().resource(HOSTURL + "/browse/Classification?itemInfo=true&offset=5&size=10&childs=true").accept(MediaType.APPLICATION_JSON).get(JSONObject.class);
        assert result.getLong("size") == 10;
        assert result.getLong("offset") == 5;
        assert result.getLong("totalSize") == 17;
        resultItems = result.getJSONArray("items");

        for (int i = 0; i < resultItems.length(); i++) {
            JSONObject item = ((JSONObject) resultItems.get(i)).getJSONObject("item");
            Classification classification = jsonProvider.fromJson(item.toString(), Classification.class);
            assert classification != null;
            assert classification.getName() != null;
            JSONArray childItems = ((JSONObject) resultItems.get(i)).optJSONArray("childItems");
            assert childItems != null;
        }
    }
View Full Code Here

TOP

Related Classes of org.socialmusicdiscovery.server.business.model.classification.Classification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.