// Path: src/test/java/de/galan/verjson/test/TestBean.java
// public class TestBean {
// 
// 	public String content;
// 	public Long number;
// 	public Object unrecognized;
// 
// 
// 	public TestBean content(String value) {
// 		content = value;
// 		return this;
// 	}
// 
// 
// 	public TestBean number(Long value) {
// 		number = value;
// 		return this;
// 	}
// 
// 
// 	public TestBean unrecognized(Object obj) {
// 		unrecognized = obj;
// 		return this;
// 	}
// 
// 
// 	@Override
// 	public int hashCode() {
// 		return Objects.hash(content, number);
// 	}
// 
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		return EqualsBuilder.reflectionEquals(this, obj, false);
// 	}
// 
// }
// 
// Path: src/main/java/de/galan/verjson/util/MetaWrapper.java
// public class MetaWrapper {
// 
// 	public static final String ID_VERSION = "$v";
// 	public static final String ID_NAMESPACE = "$ns";
// 	public static final String ID_DATA = "$d";
// 	public static final String ID_TIMESTAMP = "$ts";
// 
// 	/** Incremental version */
// 	@JsonProperty(ID_VERSION)
// 	private long version;
// 
// 	/** Namespace for the data object */
// 	@JsonProperty(ID_NAMESPACE)
// 	private String namespace;
// 
// 	/** Timestamp when the object was serialized */
// 	@JsonProperty(ID_TIMESTAMP)
// 	private Date timestamp;
// 
// 	/** Actual payload */
// 	@JsonProperty(ID_DATA)
// 	private Object data;
// 
// 
// 	public MetaWrapper(long version, String namespace, Object data, Date timestamp) {
// 		this.version = version;
// 		this.namespace = namespace;
// 		this.data = data;
// 		this.timestamp = timestamp;
// 	}
// 
// 
// 	/** Returns the data node from a wrapped JsonNode */
// 	public static JsonNode getData(JsonNode node) {
// 		return getObj(obj(node), MetaWrapper.ID_DATA);
// 	}
// 
// 
// 	/** Returns the namespace from a wrapped JsonNode */
// 	public static String getNamespace(JsonNode node) {
// 		JsonNode nodeNs = obj(node).get(ID_NAMESPACE);
// 		return (nodeNs != null) ? nodeNs.asText() : null;
// 	}
// 
// 
// 	/** Returns the source version from a wrapped JsonNode */
// 	public static Long getVersion(JsonNode node) {
// 		return obj(node).get(ID_VERSION).asLong();
// 	}
// 
// 
// 	/** Sets the version on a wrapped JsonNode */
// 	public static void setVersion(JsonNode node, Long version) {
// 		obj(node).put(ID_VERSION, version);
// 	}
// 
// 
// 	/** Returns the timestamp from a wrapped JsonNode */
// 	public static Date getTimestamp(JsonNode node) {
// 		String text = obj(node).get(ID_TIMESTAMP).asText();
// 		return isNotBlank(text) ? from(instantUtc(text)).toDate() : null;
// 	}
// 
// }


import static de.galan.commons.test.Tests.*;
import static org.apache.commons.lang3.StringUtils.*;
import static org.assertj.core.api.Assertions.*;
import java.io.IOException;
import org.junit.Test;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.galan.commons.test.AbstractTestParent;
import de.galan.verjson.test.TestBean;
import de.galan.verjson.util.MetaWrapper;
		}
		catch (InvalidJsonException ex) {
			assertThat(ex.getMessage()).isEqualTo("Could not validate JSON against schema (test)");
		}
	}


	@Test
	public void emptyJson() throws Exception {
		Validation val = create("TestBean-schema-01.txt", null);
		try {
			val.process(readNode("TestBean-json-empty.txt"));
			fail("should be invalid");
		}
		catch (InvalidJsonException ex) {
			assertThat(ex.getMessage()).isEqualTo(readFile(getClass(), "emptyJson-result.txt"));
		}
	}


	@Test
	public void simpleJson() throws Exception {
		TestBean bean = new TestBean().content("aaa").number(3L);
		Validation val = create("TestBean-schema-01.txt", "test");
		val.process(createNode(bean));
	}


	@Test
	public void invalidJson() throws Exception {
// Path: src/test/java/de/galan/verjson/test/TestBean.java
// public class TestBean {
// 
// 	public String content;
// 	public Long number;
// 	public Object unrecognized;
// 
// 
// 	public TestBean content(String value) {
// 		content = value;
// 		return this;
// 	}
// 
// 
// 	public TestBean number(Long value) {
// 		number = value;
// 		return this;
// 	}
// 
// 
// 	public TestBean unrecognized(Object obj) {
// 		unrecognized = obj;
// 		return this;
// 	}
// 
// 
// 	@Override
// 	public int hashCode() {
// 		return Objects.hash(content, number);
// 	}
// 
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		return EqualsBuilder.reflectionEquals(this, obj, false);
// 	}
// 
// }
// 
// Path: src/main/java/de/galan/verjson/util/MetaWrapper.java
// public class MetaWrapper {
// 
// 	public static final String ID_VERSION = "$v";
// 	public static final String ID_NAMESPACE = "$ns";
// 	public static final String ID_DATA = "$d";
// 	public static final String ID_TIMESTAMP = "$ts";
// 
// 	/** Incremental version */
// 	@JsonProperty(ID_VERSION)
// 	private long version;
// 
// 	/** Namespace for the data object */
// 	@JsonProperty(ID_NAMESPACE)
// 	private String namespace;
// 
// 	/** Timestamp when the object was serialized */
// 	@JsonProperty(ID_TIMESTAMP)
// 	private Date timestamp;
// 
// 	/** Actual payload */
// 	@JsonProperty(ID_DATA)
// 	private Object data;
// 
// 
// 	public MetaWrapper(long version, String namespace, Object data, Date timestamp) {
// 		this.version = version;
// 		this.namespace = namespace;
// 		this.data = data;
// 		this.timestamp = timestamp;
// 	}
// 
// 
// 	/** Returns the data node from a wrapped JsonNode */
// 	public static JsonNode getData(JsonNode node) {
// 		return getObj(obj(node), MetaWrapper.ID_DATA);
// 	}
// 
// 
// 	/** Returns the namespace from a wrapped JsonNode */
// 	public static String getNamespace(JsonNode node) {
// 		JsonNode nodeNs = obj(node).get(ID_NAMESPACE);
// 		return (nodeNs != null) ? nodeNs.asText() : null;
// 	}
// 
// 
// 	/** Returns the source version from a wrapped JsonNode */
// 	public static Long getVersion(JsonNode node) {
// 		return obj(node).get(ID_VERSION).asLong();
// 	}
// 
// 
// 	/** Sets the version on a wrapped JsonNode */
// 	public static void setVersion(JsonNode node, Long version) {
// 		obj(node).put(ID_VERSION, version);
// 	}
// 
// 
// 	/** Returns the timestamp from a wrapped JsonNode */
// 	public static Date getTimestamp(JsonNode node) {
// 		String text = obj(node).get(ID_TIMESTAMP).asText();
// 		return isNotBlank(text) ? from(instantUtc(text)).toDate() : null;
// 	}
// 
// }


// Path: src/test/java/de/galan/verjson/step/validation/ValidationTest.java
import static de.galan.commons.test.Tests.*;
import static org.apache.commons.lang3.StringUtils.*;
import static org.assertj.core.api.Assertions.*;
import java.io.IOException;
import org.junit.Test;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.galan.commons.test.AbstractTestParent;
import de.galan.verjson.test.TestBean;
import de.galan.verjson.util.MetaWrapper;

		}
		catch (InvalidJsonException ex) {
			assertThat(ex.getMessage()).isEqualTo("Could not validate JSON against schema (test)");
		}
	}


	@Test
	public void emptyJson() throws Exception {
		Validation val = create("TestBean-schema-01.txt", null);
		try {
			val.process(readNode("TestBean-json-empty.txt"));
			fail("should be invalid");
		}
		catch (InvalidJsonException ex) {
			assertThat(ex.getMessage()).isEqualTo(readFile(getClass(), "emptyJson-result.txt"));
		}
	}


	@Test
	public void simpleJson() throws Exception {
		TestBean bean = new TestBean().content("aaa").number(3L);
		Validation val = create("TestBean-schema-01.txt", "test");
		val.process(createNode(bean));
	}


	@Test
	public void invalidJson() throws Exception {
		TestBean bean = new TestBean().number(3L).unrecognized("blarg");