Do you have an IPod yet?
", result.getBodyHtml()); 27 | assertEquals("get on the train now", result.getTitle()); 28 | assertEquals("Dennis", result.getAuthor()); 29 | assertEquals("2008-07-31T20:00:00-04:00", result.getUpdatedAt()); 30 | assertEquals(null, result.getSummaryHtml()); 31 | assertEquals(241253187, result.getBlogId()); 32 | assertEquals("Announcing", result.getTags()); 33 | assertEquals(134645308, result.getId()); 34 | assertEquals(799407056, result.getUserId()); 35 | assertEquals("2008-07-31T20:00:00-04:00", result.getPublishedAt()); 36 | } 37 | } 38 | 39 | public void testLoadingSeveralAssets() throws Exception { 40 | String articlesJson = AssetLoader.loadAsset("fixtures/Article/articles.json"); 41 | 42 | JsonNode node = mapper.readValue(articlesJson, JsonNode.class); 43 | Article[] articles = mapper.readValue(node.iterator().next(), Article[].class); 44 | 45 | assertEquals(2, articles.length); 46 | 47 | for(Article a : articles) { 48 | switch(a.getId()) { 49 | case 989034056: 50 | assertEquals("John", a.getAuthor()); 51 | assertEquals("Some crazy article I'm coming up with", a.getTitle()); 52 | break; 53 | case 134645308: 54 | assertEquals("Dennis", a.getAuthor()); 55 | assertEquals("Announcing", a.getTags()); 56 | break; 57 | default: 58 | fail("Encountered unexpected article " + a.getId()); 59 | } 60 | } 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/apache/commons/codec/Decoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package com.apache.commons.codec; 19 | 20 | /** 21 | *Provides the highest level of abstraction for Decoders. 22 | * This is the sister interface of {@link Encoder}. All 23 | * Decoders implement this common generic interface.
24 | * 25 | *Allows a user to pass a generic Object to any Decoder 26 | * implementation in the codec package.
27 | * 28 | *One of the two interfaces at the center of the codec package.
29 | * 30 | * @author Apache Software Foundation 31 | * @version $Id: Decoder.java 1075404 2011-02-28 16:17:29Z ggregory $ 32 | */ 33 | public interface Decoder { 34 | 35 | /** 36 | * Decodes an "encoded" Object and returns a "decoded" 37 | * Object. Note that the implementation of this 38 | * interface will try to cast the Object parameter 39 | * to the specific type expected by a particular Decoder 40 | * implementation. If a {@link ClassCastException} occurs 41 | * this decode method will throw a DecoderException. 42 | * 43 | * @param source the object to decode 44 | * 45 | * @return a 'decoded" object 46 | * 47 | * @throws DecoderException a decoder exception can 48 | * be thrown for any number of reasons. Some good 49 | * candidates are that the parameter passed to this 50 | * method is null, a param cannot be cast to the 51 | * appropriate type for a specific encoder. 52 | */ 53 | Object decode(Object source) throws DecoderException; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /ShopifyAPI/src/com/shopify/api/resources/MGPage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DO NOT MODIFY THIS CODE 3 | * 4 | * Place all of your changes in Page.java 5 | * 6 | * It has been machine generated from fixtures and your changes will be 7 | * lost if anything new needs to be added to the API. 8 | **/ 9 | // Last Generated: 2011-09-26T15:53:49-04:00 10 | package com.shopify.api.resources; 11 | 12 | import java.util.List; 13 | import org.codehaus.jackson.annotate.JsonProperty; 14 | 15 | /** 16 | * This code has been machine generated by processing the single entry 17 | * fixtures found from the Shopify API Documentation 18 | */ 19 | 20 | public class MGPage extends ShopifyResource { 21 | 22 | @JsonProperty("author") 23 | public String getAuthor() { 24 | return (String)getAttribute("author"); 25 | } 26 | @JsonProperty("author") 27 | public void setAuthor(String _author) { 28 | setAttribute("author", _author); 29 | } 30 | 31 | @JsonProperty("body_html") 32 | public String getBodyHtml() { 33 | return (String)getAttribute("body_html"); 34 | } 35 | @JsonProperty("body_html") 36 | public void setBodyHtml(String _body_html) { 37 | setAttribute("body_html", _body_html); 38 | } 39 | 40 | @JsonProperty("handle") 41 | public String getHandle() { 42 | return (String)getAttribute("handle"); 43 | } 44 | @JsonProperty("handle") 45 | public void setHandle(String _handle) { 46 | setAttribute("handle", _handle); 47 | } 48 | 49 | @JsonProperty("published_at") 50 | public String getPublishedAt() { 51 | return (String)getAttribute("published_at"); 52 | } 53 | @JsonProperty("published_at") 54 | public void setPublishedAt(String _published_at) { 55 | setAttribute("published_at", _published_at); 56 | } 57 | 58 | @JsonProperty("shop_id") 59 | public int getShopId() { 60 | Integer value = (Integer)getAttribute("shop_id"); 61 | return value != null ? value : 0; 62 | } 63 | @JsonProperty("shop_id") 64 | public void setShopId(int _shop_id) { 65 | setAttribute("shop_id", _shop_id); 66 | } 67 | 68 | @JsonProperty("template_suffix") 69 | public String getTemplateSuffix() { 70 | return (String)getAttribute("template_suffix"); 71 | } 72 | @JsonProperty("template_suffix") 73 | public void setTemplateSuffix(String _template_suffix) { 74 | setAttribute("template_suffix", _template_suffix); 75 | } 76 | 77 | @JsonProperty("title") 78 | public String getTitle() { 79 | return (String)getAttribute("title"); 80 | } 81 | @JsonProperty("title") 82 | public void setTitle(String _title) { 83 | setAttribute("title", _title); 84 | } 85 | 86 | } 87 | --------------------------------------------------------------------------------