Skip to content

Commit

Permalink
Added first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pasupathi-Rajamanickam committed Sep 8, 2018
1 parent 634658d commit 3583073
Show file tree
Hide file tree
Showing 16 changed files with 1,097 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/target/
/.project
/Report/
2 changes: 2 additions & 0 deletions .settings/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/org.eclipse.jdt.core.prefs
/org.eclipse.m2e.core.prefs
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# json-diff-report
Command line API call compare JSON and provide great json comparison report

## What it does?
This utility built on JAVA, it's a command line based tool to execute API calls and do comparison

## Setup
1. Download latest release from https://github.com/next-time-space/json-diff-report/releases
2. Extract to a directory
3. Edit file input.json with all the API information
4. Execute the utiliy using java -jar json-diff-report.jar
5. Report will be created in the folder called "Report"
Empty file added app.conf
Empty file.
56 changes: 56 additions & 0 deletions input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"inputs": [
{
"urlSource": "https://api.stackexchange.com/2.2/questions/51227849?order=desc&sort=activity&site=stackoverflow",
"urlCompare": "https://api.stackexchange.com/2.2/questions/28668452?order=desc&sort=activity&site=stackoverflow",
"method": null,
"headersSource": {
"accept": "application/json"
},
"headersCompare": {
"accept": "application/json"
},
"requestSource": null,
"requestCompare": null
},
{
"urlSource": "https://api3.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=today",
"urlCompare": "https://api3.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=2018-09-10",
"method": null,
"headersSource": {
"accept": "application/json"
},
"headersCompare": {
"accept": "application/json"
},
"requestSource": null,
"requestCompare": null
},
{
"urlSource": "https://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=today",
"urlCompare": "https://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=2018-09-10",
"method": null,
"headersSource": {
"accept": "application/json"
},
"headersCompare": {
"accept": "application/json"
},
"requestSource": null,
"requestCompare": null
},
{
"urlSource": "http://api.oceandrivers.com/static/resources.json",
"urlCompare": "http://api.oceandrivers.com/static/resources.json",
"method": null,
"headersSource": {
"accept": "application/json"
},
"headersCompare": {
"accept": "application/json"
},
"requestSource": null,
"requestCompare": null
}
]
}
93 changes: 93 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.nexttimespace.utilities</groupId>
<artifactId>json-diff-report</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>Provides JSON differences in HTML format</description>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.nexttimespace.utilities.diffbox.Executor</mainClass>
</manifest>
</archive>

</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.test.skip>true</maven.test.skip>
</properties>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>26.0-jre</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
<version>0.9.5</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.8.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.6</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.5</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.nexttimespace.utilities.diffbox;

import java.io.Serializable;

public class DiffResponse implements Serializable{
private static final long serialVersionUID = 3451985135067844197L;
private String sourceTag;
private String compareWithTag;
private String sourceValue;
private String compareWithValue;
private boolean status;
public String getSourceTag() {
return sourceTag;
}
public void setSourceTag(String sourceTag) {
this.sourceTag = sourceTag;
}
public String getCompareWithTag() {
return compareWithTag;
}
public void setCompareWithTag(String compareWithTag) {
this.compareWithTag = compareWithTag;
}
public String getSourceValue() {
return sourceValue;
}
public void setSourceValue(String sourceValue) {
this.sourceValue = sourceValue;
}
public String getCompareWithValue() {
return compareWithValue;
}
public void setCompareWithValue(String compareWithValue) {
this.compareWithValue = compareWithValue;
}
public boolean isStatus() {
return status;
}
public void setStatus(boolean status) {
this.status = status;
}
}
Loading

0 comments on commit 3583073

Please sign in to comment.