-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
importing json file from command line. related to #33
- Loading branch information
Gustavo Pinto
committed
May 12, 2013
1 parent
24cdeb1
commit d629494
Showing
5 changed files
with
172 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"forge": "github", | ||
"dest": "C:/groundhog/dest", | ||
"out": "C:/groundhog/metrics", | ||
"datetime": "2012-07-01_12_00", | ||
"nprojects": 30, | ||
"nthreads": 4, | ||
"outputformat": "csv", | ||
"search": { | ||
"projects": ["rails", "bootstrap"], | ||
"username":"gustavopinto" | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/java/main/br/ufpe/cin/groundhog/main/JsonInputArgs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package br.ufpe.cin.groundhog.main; | ||
|
||
import java.util.List; | ||
|
||
public final class JsonInputArgs { | ||
private final String forge; | ||
private final String dest; | ||
private final String out; | ||
private final String datetime; | ||
private final String nprojects; | ||
private final String outputformat; | ||
private final Search search; | ||
|
||
public JsonInputArgs(String forge, String dest, String out, | ||
String datetime, String nprojects, String outputformat, | ||
Search search) { | ||
this.forge = forge; | ||
this.dest = dest; | ||
this.out = out; | ||
this.datetime = datetime; | ||
this.nprojects = nprojects; | ||
this.outputformat = outputformat; | ||
this.search = search; | ||
} | ||
|
||
public String getForge() { | ||
return forge; | ||
} | ||
|
||
public String getDest() { | ||
return dest; | ||
} | ||
|
||
public String getOut() { | ||
return out; | ||
} | ||
|
||
public String getDatetime() { | ||
return datetime; | ||
} | ||
|
||
public String getNprojects() { | ||
return nprojects; | ||
} | ||
|
||
public String getOutputformat() { | ||
return outputformat; | ||
} | ||
|
||
public Search getSearch() { | ||
return search; | ||
} | ||
} | ||
|
||
class Search { | ||
private final List<String> projects; | ||
private final String username; | ||
|
||
public Search(List<String> projects, String username) { | ||
super(); | ||
this.projects = projects; | ||
this.username = username; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public List<String> getProjects() { | ||
return projects; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package br.ufpe.cin.groundhog.main; | ||
|
||
import java.io.File; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
public class OptionTest { | ||
|
||
@Test | ||
public void testJsonInputFile() { | ||
Options op = new Options(); | ||
op.setInputFile(new File( | ||
"/home/ghlp/workspace/java/groundhog/grounghog.json")); | ||
Assert.assertNotNull(op.getInputFile()); | ||
} | ||
} |