Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robert h schmidt #236

Merged
merged 15 commits into from
Aug 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions src/java/boa/datagen/forges/github/DuplicateRepoWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,7 @@ private void removeDuplicates(){
continue;
}
names.add(name);
int id = repo.get("id").getAsInt();
JsonObject owner = repo.get("owner").getAsJsonObject();
String created_at = null;
if (repo.has("created_at"))
created_at = repo.get("created_at").getAsString();
boolean fork = repo.get("fork").getAsBoolean();
String description = null;
if (!repo.get("description").isJsonNull())
description = repo.get("description").getAsString();
JsonObject langList = new JsonObject();
if (repo.has("language_list")){
if(!repo.get("language_list").isJsonObject()){
String brokenList = repo.get("language_list").getAsString();
brokenList = brokenList.replace("\\", "");
repo.remove("language_list");
repo.addProperty("language_list", brokenList);
}
if (repo.get("language_list").isJsonObject())
langList = repo.get("language_list").getAsJsonObject();
}

JsonObject reducedRepo = new JsonObject();
reducedRepo.addProperty("id", id);
reducedRepo.addProperty("full_name", name);
reducedRepo.add("owner", owner);
reducedRepo.addProperty("created_at", created_at);
reducedRepo.addProperty("fork", fork);
reducedRepo.addProperty("description", description);
reducedRepo.add("language_list", langList);
this.addRepo(reducedRepo);
this.addRepo(repo);
}
System.out.println(Thread.currentThread().getId() + " processing: " + i);
}
Expand Down
4 changes: 2 additions & 2 deletions src/java/boa/datagen/forges/github/GitHubJsonRetriever.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ private void buildNamesList() {
try {
sc = new Scanner(new File(InputFile));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
while (sc.hasNextLine())
while (sc.hasNextLine())
namesList.add(sc.nextLine());
sc.close();
System.out.println(namesList.size() + " names");
}

Expand Down
4 changes: 2 additions & 2 deletions src/java/boa/datagen/forges/github/JsonSplitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public void split() {
continue;
int index = i % Num_Threads;
File file = new File(outDir + index + "/" + files[i].getName());
String content = FileIO.readFileContents(file);
System.out.println("processing " + file.getName());
String content = FileIO.readFileContents(files[i]);
System.out.println("processing " + i + "/" + files.length + " " +file.getName());
FileIO.writeFileContents(file, content);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import org.junit.Test;

public class TestProgramingLanguages extends QueryTest {
public class TestCatAp1 extends QueryTest {

@Test
public void testProgramingLanguages() {
public void testCatAp1() {
String expected = "counts[] = Java, 1.0\n";
queryTest("test/known-good/catAp1.boa", expected);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import org.junit.Test;

public class TestYearCreated extends QueryTest {
public class TestCatAp3 extends QueryTest {

@Test
public void testYearCreated() {
public void testCatAp3() {
String expected = "counts[2018] = 1\n";
queryTest("test/known-good/catAp3.boa", expected);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import org.junit.Test;

public class TestYearJavaAdded extends QueryTest {
public class TestCatAp4 extends QueryTest {

@Test
public void testYearJavaAdded() {
public void testCatAp4() {
String expected = "counts[2018] = 1\n";
queryTest("test/known-good/catAp4.boa", expected);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import org.junit.Test;

public class TestNumberOfRevisions extends QueryTest {
public class TestCatBp1 extends QueryTest {

@Test
public void testNumberOfRevisions() {
public void testCatBp1() {
String expected = "counts[] = 49\n";
queryTest("test/known-good/catBp1.boa", expected);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import org.junit.Test;

public class TestChurnRate extends QueryTest {
public class TestCatBp14 extends QueryTest {

@Test
public void testChurnRate() {
public void testCatBp14() {
String expected = "counts[] = 5.530612244897959\n";
queryTest("test/known-good/catBp14.boa", expected);
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/boa/test/datagen/queries/TestCatBp3.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class TestCatBp3 extends QueryTest {

@Test
public void testcatBp18() {
public void testcatBp3() {
String expected = "counts[] = 2\n";
queryTest("test/known-good/catBp3.boa", expected);
}
Expand Down
149 changes: 149 additions & 0 deletions src/test/boa/test/datagen/queries/TestDupeTypes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
package boa.test.datagen.queries;

import org.junit.Test;

public class TestDupeTypes extends QueryTest {

@Test
public void testDupeTypes() {
String expected = "types[140492550][Account] = src/JLS8/LambdaDemo/v10/LambdaDemo.java\n"
+ "types[140492550][Account] = src/JLS8/LambdaDemo/v9/LambdaDemo.java\n"
+ "types[140492550][Account] = src/JLS8/RADemo/Account.java\n"
+ "types[140492550][Accountant] = src/JLS2/GenDemo/v2/GenDemo.java\n"
+ "types[140492550][Accountant] = src/JLS3/GenDemo/v2/GenDemo.java\n"
+ "types[140492550][Accountant] = src/JLS3/GenDemo/v2/GenDemo2.java\n"
+ "types[140492550][AnnDemo] = src/JLS3/AnnDemo/v4/AnnDemo.java\n"
+ "types[140492550][AnnDemo] = src/JLS3/AnnDemo/v5/AnnDemo.java\n"
+ "types[140492550][AnnDemo] = src/JLS3/AnnProcDemo/AnnDemo.java\n"
+ "types[140492550][AnnDemo] = src/JLS3/AnnDemo/v3/AnnDemo.java\n"
+ "types[140492550][AnnDemo] = src/JLS3/AnnDemo/v1/AnnDemo.java\n"
+ "types[140492550][AnnDemo] = src/JLS3/AnnDemo/v2/AnnDemo.java\n"
+ "types[140492550][AnnProcDemo] = src/JLS3/AnnProcDemo/AnnProcDemo.java\n"
+ "types[140492550][AssertDemo] = src/JLS2/AssertDemo/v1/AssertDemo.java\n"
+ "types[140492550][AssertDemo] = src/JLS2/AssertDemo/v4/AssertDemo.java\n"
+ "types[140492550][AssertDemo] = src/JLS2/AssertDemo/v2/AssertDemo.java\n"
+ "types[140492550][AssertDemo] = src/JLS2/AssertDemo/v3/AssertDemo.java\n"
+ "types[140492550][BinLitDemo] = src/JLS4/BinLitDemo/BinLitDemo.java\n"
+ "types[140492550][BoxDemo] = src/JLS3/BoxDemo/v2/BoxDemo.java\n"
+ "types[140492550][BoxDemo] = src/JLS4/BoxDemo/BoxDemo.java\n"
+ "types[140492550][BoxDemo] = src/JLS3/BoxDemo/v1/BoxDemo.java\n"
+ "types[140492550][Box] = src/JLS4/BoxDemo/Box.java\n"
+ "types[140492550][BreakageDemo] = src/JLS4/BreakageDemo/BreakageDemo.java\n"
+ "types[140492550][Car] = src/JLS8/DMDemo/v3/DMDemo.java\n"
+ "types[140492550][Car] = src/JLS8/DMDemo/v2/DMDemo.java\n"
+ "types[140492550][Car] = src/JLS8/DMDemo/v1/DMDemo.java\n"
+ "types[140492550][CardboardFactory] = src/JLS3/CovarDemo/v2/CovarDemo.java\n"
+ "types[140492550][CardboardFactory] = src/JLS3/CovarDemo/v1/CovarDemo.java\n"
+ "types[140492550][Cardboard] = src/JLS3/CovarDemo/v2/CovarDemo.java\n"
+ "types[140492550][Cardboard] = src/JLS3/CovarDemo/v1/CovarDemo.java\n"
+ "types[140492550][Container] = src/JLS2/GenDemo/v1/GenDemo.java\n"
+ "types[140492550][Container] = src/JLS3/GenDemo/v1/GenDemo.java\n"
+ "types[140492550][Container] = src/JLS3/GenDemo/v1/GenDemo1.java\n"
+ "types[140492550][CopyToDatabaseOrFile] = src/JLS4/CopyToDatabaseOrFile/v1/CopyToDatabaseOrFile.java\n"
+ "types[140492550][CopyToDatabaseOrFile] = src/JLS4/CopyToDatabaseOrFile/v2/CopyToDatabaseOrFile.java\n"
+ "types[140492550][Copy] = src/JLS4/Copy/v1/Copy.java\n"
+ "types[140492550][Copy] = src/JLS4/Copy/v2/Copy.java\n"
+ "types[140492550][CovarDemo] = src/JLS3/CovarDemo/v2/CovarDemo.java\n"
+ "types[140492550][CovarDemo] = src/JLS3/CovarDemo/v1/CovarDemo.java\n"
+ "types[140492550][DMDemo] = src/JLS8/DMDemo/v3/DMDemo.java\n"
+ "types[140492550][DMDemo] = src/JLS8/DMDemo/v4/DMDemo.java\n"
+ "types[140492550][DMDemo] = src/JLS8/DMDemo/v2/DMDemo.java\n"
+ "types[140492550][DMDemo] = src/JLS8/DMDemo/v1/DMDemo.java\n"
+ "types[140492550][Drawable] = src/JLS8/SMDemo/Drawable.java\n"
+ "types[140492550][Drivable] = src/JLS8/DMDemo/v1/Drivable.java\n"
+ "types[140492550][Drivable] = src/JLS8/DMDemo/v2/Drivable.java\n"
+ "types[140492550][Drivable] = src/JLS8/DMDemo/v3/Drivable.java\n"
+ "types[140492550][Employee] = src/JLS2/GenDemo/v2/GenDemo.java\n"
+ "types[140492550][Employee] = src/JLS3/GenDemo/v2/GenDemo.java\n"
+ "types[140492550][Employee] = src/JLS3/GenDemo/v2/GenDemo2.java\n"
+ "types[140492550][Employee] = src/JLS3/EnForLoopDemo/v1/EnForLoopDemo.java\n"
+ "types[140492550][EnForLoopDemo] = src/JLS3/EnForLoopDemo/v2/EnForLoopDemo.java\n"
+ "types[140492550][EnForLoopDemo] = src/JLS3/EnForLoopDemo/v1/EnForLoopDemo.java\n"
+ "types[140492550][Filter] = src/JLS3/GenDemo/v5/GenDemo5.java\n"
+ "types[140492550][Filter] = src/JLS3/GenDemo/v5/GenDemo.java\n"
+ "types[140492550][Filter] = src/JLS2/GenDemo/v5/GenDemo.java\n"
+ "types[140492550][GenDemo.] = src/JLS3/GenDemo/v5/GenDemo5.java\n"
+ "types[140492550][GenDemo.] = src/JLS3/GenDemo/v5/GenDemo.java\n"
+ "types[140492550][GenDemo.] = src/JLS2/GenDemo/v5/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS2/GenDemo/v2/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS2/GenDemo/v1/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS2/GenDemo/v4/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v5/GenDemo5.java\n"
+ "types[140492550][GenDemo] = src/JLS2/GenDemo/v5/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v3/GenDemo3.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v1/GenDemo1.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v4/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v3/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v2/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v5/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v1/GenDemo.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v4/GenDemo4.java\n"
+ "types[140492550][GenDemo] = src/JLS3/GenDemo/v2/GenDemo2.java\n"
+ "types[140492550][GenDemo] = src/JLS2/GenDemo/v3/GenDemo.java\n"
+ "types[140492550][HeapPollutionDemo] = src/JLS4/HeapPollutionDemo/HeapPollutionDemo.java\n"
+ "types[140492550][LambdaDemo.] = src/JLS8/LambdaDemo/v7/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo.] = src/JLS8/LambdaDemo/v2/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo.] = src/JLS8/LambdaDemo/v4/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v1/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v3/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v6/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v7/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v2/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v10/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v4/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v9/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v8/LambdaDemo.java\n"
+ "types[140492550][LambdaDemo] = src/JLS8/LambdaDemo/v5/LambdaDemo.java\n"
+ "types[140492550][Light] = src/JLS3/StaticImportsDemo/v1/Light.java\n"
+ "types[140492550][MRDemo.] = src/JLS8/MRDemo/v3/MRDemo.java\n"
+ "types[140492550][MRDemo.] = src/JLS8/MRDemo/v2/MRDemo.java\n"
+ "types[140492550][MRDemo] = src/JLS8/MRDemo/v1/MRDemo.java\n"
+ "types[140492550][MRDemo] = src/JLS8/MRDemo/v3/MRDemo.java\n"
+ "types[140492550][MRDemo] = src/JLS8/MRDemo/v4/MRDemo.java\n"
+ "types[140492550][MRDemo] = src/JLS8/MRDemo/v5/MRDemo.java\n"
+ "types[140492550][MRDemo] = src/JLS8/MRDemo/v6/MRDemo.java\n"
+ "types[140492550][MRDemo] = src/JLS8/MRDemo/v2/MRDemo.java\n"
+ "types[140492550][Marble] = src/JLS4/BoxDemo/Marble.java\n"
+ "types[140492550][MonitorEngine] = src/JLS4/MonitorEngine/v2/MonitorEngine.java\n"
+ "types[140492550][MonitorEngine] = src/JLS4/MonitorEngine/v1/MonitorEngine.java\n"
+ "types[140492550][PNG] = src/JLS2/AssertDemo/v3/AssertDemo.java\n"
+ "types[140492550][PaperFactory] = src/JLS3/CovarDemo/v2/CovarDemo.java\n"
+ "types[140492550][PaperFactory] = src/JLS3/CovarDemo/v1/CovarDemo.java\n"
+ "types[140492550][Paper] = src/JLS3/CovarDemo/v2/CovarDemo.java\n"
+ "types[140492550][Paper] = src/JLS3/CovarDemo/v1/CovarDemo.java\n"
+ "types[140492550][Planets] = src/JLS4/Planets/Planets.java\n"
+ "types[140492550][PressureException] = src/JLS4/MonitorEngine/v2/MonitorEngine.java\n"
+ "types[140492550][PressureException] = src/JLS4/MonitorEngine/v1/MonitorEngine.java\n"
+ "types[140492550][SortInts.] = src/JLS4/SortInts/v1/SortInts.java\n"
+ "types[140492550][SortInts.] = src/JLS4/SortInts/v2/SortInts.java\n"
+ "types[140492550][SortInts] = src/JLS4/SortInts/v1/SortInts.java\n"
+ "types[140492550][SortInts] = src/JLS4/SortInts/v2/SortInts.java\n"
+ "types[140492550][SortedEmployees] = src/JLS2/GenDemo/v2/GenDemo.java\n"
+ "types[140492550][SortedEmployees] = src/JLS3/GenDemo/v2/GenDemo.java\n"
+ "types[140492550][SortedEmployees] = src/JLS3/GenDemo/v2/GenDemo2.java\n"
+ "types[140492550][StaticImportsDemo] = src/JLS3/StaticImportsDemo/v1/StaticImportsDemo.java\n"
+ "types[140492550][StaticImportsDemo] = src/JLS3/StaticImportsDemo/v2/StaticImportsDemo.java\n"
+ "types[140492550][SubException1] = src/JLS4/BreakageDemo/BreakageDemo.java\n"
+ "types[140492550][SubException2] = src/JLS4/BreakageDemo/BreakageDemo.java\n"
+ "types[140492550][SuperException] = src/JLS4/BreakageDemo/BreakageDemo.java\n"
+ "types[140492550][Switchable] = src/JLS3/StaticImportsDemo/v1/Switchable.java\n"
+ "types[140492550][TEDemo] = src/JLS3/TEDemo/v1/TEDemo.java\n"
+ "types[140492550][TEDemo] = src/JLS3/TEDemo/v2/TEDemo.java\n"
+ "types[140492550][TemperatureException] = src/JLS4/MonitorEngine/v2/MonitorEngine.java\n"
+ "types[140492550][TemperatureException] = src/JLS4/MonitorEngine/v1/MonitorEngine.java\n"
+ "types[140492550][ToDo] = src/JLS3/AnnDemo/v4/ToDo.java\n"
+ "types[140492550][ToDo] = src/JLS8/RADemo/ToDo.java\n"
+ "types[140492550][ToDo] = src/JLS3/AnnProcDemo/ToDo.java\n"
+ "types[140492550][ToDo] = src/JLS3/AnnDemo/v3/ToDo.java\n"
+ "types[140492550][ToDo] = src/JLS3/AnnDemo/v5/ToDo.java\n"
+ "types[140492550][ToDo] = src/JLS3/AnnDemo/v2/ToDo.java\n"
+ "types[140492550][TransientDemo.Transient] = src/JLS2/TransientDemo/Transient.java\n"
+ "types[140492550][UndLitDemo] = src/JLS4/UndLitDemo/UndLitDemo.java\n"
+ "types[140492550][UnsafeVarargsDemo2] = src/JLS4/UnsafeVarargsDemo/UnsafeVarargsDemo2.java\n"
+ "types[140492550][UnsafeVarargsDemo] = src/JLS4/UnsafeVarargsDemo/UnsafeVarargsDemo.java\n"
+ "types[140492550][Volatile.VolatileDemo] = src/JLS2/Volatile/VolatileDemo.java\n"
+ "types[140492550][foo.Light] = src/JLS3/StaticImportsDemo/v2/foo/Light.java\n"
+ "types[140492550][foo.Switchable] = src/JLS3/StaticImportsDemo/v2/foo/Switchable.java\n";
queryTest("test/known-good/dupe-types.boa", expected);
}
}
29 changes: 29 additions & 0 deletions src/test/boa/test/datagen/queries/TestEnhancedFor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package boa.test.datagen.queries;

import org.junit.Test;

public class TestEnhancedFor extends QueryTest {

@Test
public void testEnhancedFor() {
String expected = "USES[https://github.com/boalang/test-datagen][src/JLS2/AssertDemo/v4/AssertDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/EnForLoopDemo/v1/EnForLoopDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/EnForLoopDemo/v2/EnForLoopDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/TEDemo/v2/TEDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/VarargsDemo/VarargsDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS4/Touch/Touch.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS4/UnsafeVarargsDemo/UnsafeVarargsDemo2.java][1532029613000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS4/UnsafeVarargsDemo/UnsafeVarargsDemo2.java][1532029613000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS4/UnsafeVarargsDemo/UnsafeVarargsDemo2.java][1532032882000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS4/UnsafeVarargsDemo/UnsafeVarargsDemo2.java][1532032882000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS8/LambdaDemo/v10/LambdaDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS8/LambdaDemo/v4/LambdaDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS8/LambdaDemo/v4/LambdaDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS8/LambdaDemo/v4/LambdaDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS8/LambdaDemo/v9/LambdaDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS8/MRDemo/v1/MRDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS8/MRDemo/v1/MRDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS8/RADemo/RADemo.java][1531520725000000] = 1\n";
queryTest("test/known-good/enhanced-for.boa", expected);
}
}
13 changes: 13 additions & 0 deletions src/test/boa/test/datagen/queries/TestEnums.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package boa.test.datagen.queries;

import org.junit.Test;

public class TestEnums extends QueryTest {

@Test
public void testTestEnums() {
String expected = "USES[https://github.com/boalang/test-datagen][src/JLS3/TEDemo/v1/TEDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/TEDemo/v2/TEDemo.java][1531520725000000] = 1\n";
queryTest("test/known-good/enums.boa", expected);
}
}
18 changes: 18 additions & 0 deletions src/test/boa/test/datagen/queries/TestFields.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package boa.test.datagen.queries;

import org.junit.Test;

public class TestFields extends QueryTest {

@Test
public void testFields() {
String expected = "MeanInstanceFields[] = 0.0\n"
+ "MeanPrivateFields[] = 0.0\n"
+ "MeanStaticFields[] = 0.0\n"
+ "NoFieldClasses[] = 60\n"
+ "TotalClasses[] = 73\n"
+ "TotalInstanceFields[] = 17\n"
+ "TotalStaticFields[] = 5\n";
queryTest("test/known-good/fields.boa", expected);
}
}
25 changes: 25 additions & 0 deletions src/test/boa/test/datagen/queries/TestGenericDefineType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package boa.test.datagen.queries;

import org.junit.Test;

public class TestGenericDefineType extends QueryTest{

@Test
public void testGenericsDefineType() {
String expected = "USES[https://github.com/boalang/test-datagen][src/JLS2/GenDemo/v1/GenDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS2/GenDemo/v2/GenDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS2/GenDemo/v5/GenDemo.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v1/GenDemo.java][1531532908000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v1/GenDemo1.java][1532699593000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v1/GenDemo1.java][1532699626000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v2/GenDemo.java][1531532908000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v2/GenDemo2.java][1532699593000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v2/GenDemo2.java][1532699626000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v5/GenDemo.java][1531532908000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v5/GenDemo5.java][1532699593000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS3/GenDemo/v5/GenDemo5.java][1532699626000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS4/BoxDemo/Box.java][1531520725000000] = 1\n"
+ "USES[https://github.com/boalang/test-datagen][src/JLS4/BoxDemo/Box.java][1531880750000000] = 1\n";
queryTest("test/known-good/generics-define-type.boa", expected);
}
}
Loading