-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d44191
commit 0602b2b
Showing
11 changed files
with
294 additions
and
5 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,53 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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.approvaltests</groupId> | ||
<artifactId>approvaltests-tests-jdk8</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
|
||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter</artifactId> | ||
<version>5.11.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.approvaltests</groupId> | ||
<artifactId>approvaltests</artifactId> | ||
<version>100.0.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.approvaltests</groupId> | ||
<artifactId>approvaltests-util</artifactId> | ||
<version>100.0.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.gson</groupId> | ||
<artifactId>gson</artifactId> | ||
<version>2.11.0</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>3.5.0</version> | ||
</plugin> | ||
<plugin> | ||
<version>3.13.0</version> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>8</source> | ||
<target>8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
45 changes: 45 additions & 0 deletions
45
approvaltests-tests-jdk8/src/test/java/org/approvaltests/ApprovalsTest.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,45 @@ | ||
package org.approvaltests; | ||
|
||
import org.approvaltests.core.Options; | ||
import org.approvaltests.reporters.ClipboardReporter; | ||
import org.approvaltests.reporters.DiffReporter; | ||
import org.approvaltests.reporters.QuietReporter; | ||
import org.approvaltests.reporters.EnvironmentVariableReporter; | ||
import org.approvaltests.reporters.UseReporter; | ||
import org.approvaltests.reporters.windows.BeyondCompareReporter; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import javax.swing.JButton; | ||
import java.awt.Dimension; | ||
import java.awt.Rectangle; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
@UseReporter({DiffReporter.class, ClipboardReporter.class}) | ||
public class ApprovalsTest | ||
{ | ||
@Test | ||
public void testToString() | ||
{ | ||
Rectangle objectUnderTest = new Rectangle(5, 10, 100, 200); | ||
Options options = new Options().withReporter(EnvironmentVariableReporter.INSTANCE); | ||
Approvals.verify(objectUnderTest, options); | ||
} | ||
@Test | ||
public void testAsJson() | ||
{ | ||
JsonApprovals.verifyAsJson(new Rectangle(5, 10, 100, 200)); | ||
} | ||
@Test | ||
void verifyAllTemplate() | ||
{ | ||
String[] inputs = {"input.value1", "input.value2"}; | ||
Approvals.verifyAll("TITLE", inputs, s -> "placeholder " + s); | ||
} | ||
@Test | ||
void testTwoVerify() | ||
{ | ||
Approvals.verify("one"); | ||
assertThrows(ApprovalsDuplicateVerifyException.class, () -> Approvals.verify("two")); | ||
} | ||
} |
71 changes: 71 additions & 0 deletions
71
...s-tests-jdk8/src/test/java/org/approvaltests/ApprovalsTest.testApprovalsApi.approved.html
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,71 @@ | ||
ApprovalWriter | ||
GetApprovedExtension () | ||
GetRecievedExtension () | ||
Write (File) | ||
Approvals | ||
Approve (File) | ||
Approve (ApprovalWriter,FailedApprovalReport,int) | ||
Approve (FileApprover,FailedApprovalReport) | ||
Approve (Form) | ||
Approve (String,Object[]) | ||
Approve (String) | ||
Approve (BufferedImage,int) | ||
Approve (BufferedImage) | ||
Approve (Image) | ||
ApproveHtml (String) | ||
ApprovalsTest | ||
TestApprovalsApi () | ||
TestApproveComponent () | ||
ComponentApprovalWriter | ||
GetApprovedExtension () | ||
GetRecievedExtension () | ||
ValidateComponent (Form) | ||
Write (File) | ||
FailedApprovalReport | ||
IsResultChangedByReport () | ||
Report (File,File) | ||
FailedDiffTextApprovalReport | ||
IsResultChangedByReport () | ||
Report (File,File) | ||
FailedHtmlApprovalReport | ||
IsResultChangedByReport () | ||
Report (File,File) | ||
FailedImageApprovalReport | ||
IsResultChangedByReport () | ||
Report (File,File) | ||
FailedQuietApprovalReport | ||
IsResultChangedByReport () | ||
Report (File,File) | ||
FailedTextApprovalReport | ||
IsResultChangedByReport () | ||
Report (File,File) | ||
FileApprovalWriter | ||
GetApprovedExtension () | ||
GetRecievedExtension () | ||
Write (File) | ||
FileApprover | ||
ApproveTextFile (File,File) | ||
CleanUpAfterSuccess () | ||
Fail () | ||
GetAcceptApprovalText (File,File) | ||
GetFile (StackTraceReflectionResult,String) | ||
IsApproved () | ||
IsWindowsEnviroment () | ||
Report (FailedApprovalReport) | ||
FileApproverTest | ||
CreateFile (String) | ||
TestApproveTextFile () | ||
TestApproveTextFileWithNonExsitantFile () | ||
TestGetCurrentFileForMethod () | ||
FlyingSaucerHtmlToPdfWriter | ||
GetApprovedExtension () | ||
GetRecievedExtension () | ||
Write (File) | ||
ImageApprovalWriter | ||
GetApprovedExtension () | ||
GetRecievedExtension () | ||
Write (File) | ||
TextApprovalWriter | ||
GetApprovedExtension () | ||
GetRecievedExtension () | ||
Write (File) |
89 changes: 89 additions & 0 deletions
89
...ts-tests-jdk8/src/test/java/org/approvaltests/ApprovalsTest.testApprovalsApi.approved.txt
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,89 @@ | ||
ApprovalApprover | ||
Approve() | ||
CleanUpAfterSuccess() | ||
Fail() | ||
ReportFailure(ApprovalFailureReporter) | ||
ApprovalControlWriter | ||
GetApprovalFilename(String) | ||
GetReceivedFilename(String) | ||
ValidateComponent(Form) | ||
WriteReceivedFile(String) | ||
ApprovalFailureReporter | ||
ApprovedWhenReported() | ||
Report(String,String) | ||
ApprovalNamer | ||
GetApprovalName() | ||
GetSourceFilePath() | ||
ApprovalTextWriter | ||
GetApprovalFilename(String) | ||
GetReceivedFilename(String) | ||
WriteReceivedFile(String) | ||
ApprovalWriter | ||
GetApprovalFilename(String) | ||
GetReceivedFilename(String) | ||
WriteReceivedFile(String) | ||
Approvals | ||
Approve(String) | ||
Approve(String,Object[]) | ||
Approve(String,Iterable) | ||
Approve(Form) | ||
Approve(FileApprover,ApprovalFailureReporter) | ||
Approve(File) | ||
Approve(Image) | ||
Approve(BufferedImage) | ||
Approve(ApprovalWriter,ApprovalNamer,ApprovalFailureReporter) | ||
Approve(BufferedImage,ApprovalNamer) | ||
ApproveHtml(String) | ||
NewApprovalNamer() | ||
ApprovalsTest | ||
TestApprovalsApi() | ||
TestApproveComponent() | ||
FailedDiffTextApprovalReport | ||
ApprovedWhenReported() | ||
Report(String,String) | ||
FailedFileLauncherReport | ||
ApprovedWhenReported() | ||
Report(String,String) | ||
FailedImageApprovalReport | ||
ApprovedWhenReported() | ||
Report(String,String) | ||
FailedQuietApprovalReport | ||
ApprovedWhenReported() | ||
Report(String,String) | ||
FailedTextApprovalReport | ||
ApprovedWhenReported() | ||
Report(String,String) | ||
FileApprovalWriter | ||
GetApprovalFilename(String) | ||
GetReceivedFilename(String) | ||
WriteReceivedFile(String) | ||
FileApprover | ||
Approve() | ||
ApproveTextFile(File,File) | ||
CleanUpAfterSuccess() | ||
Fail() | ||
GetAcceptApprovalText(String,String) | ||
GetFile(StackTraceReflectionResult,String) | ||
IsWindowsEnviroment() | ||
ReportFailure(ApprovalFailureReporter) | ||
FileApproverTest | ||
CreateFile(String) | ||
TestApproveTextFile() | ||
TestApproveTextFileWithNonExsitantFile() | ||
TestGetCurrentFileForMethod() | ||
FlyingSaucerHtmlToPdfWriter | ||
GetApprovalFilename(String) | ||
GetReceivedFilename(String) | ||
WriteReceivedFile(String) | ||
ImageApprovalWriter | ||
GetApprovalFilename(String) | ||
GetReceivedFilename(String) | ||
WriteReceivedFile(String) | ||
JUnitStackTraceNamer | ||
GetApprovalName() | ||
GetSourceFilePath() | ||
JUnitStackTraceNamerTest | ||
TestGetApprovalName() | ||
TestGetSourceFilePath() | ||
TestApprovals | ||
Suite() |
6 changes: 6 additions & 0 deletions
6
...altests-tests-jdk8/src/test/java/org/approvaltests/ApprovalsTest.testAsJson.approved.json
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,6 @@ | ||
{ | ||
"x": 5, | ||
"y": 10, | ||
"width": 100, | ||
"height": 200 | ||
} |
1 change: 1 addition & 0 deletions
1
...ltests-tests-jdk8/src/test/java/org/approvaltests/ApprovalsTest.testToString.approved.txt
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 @@ | ||
java.awt.Rectangle[x=5,y=10,width=100,height=200] |
1 change: 1 addition & 0 deletions
1
...tests-tests-jdk8/src/test/java/org/approvaltests/ApprovalsTest.testTwoVerify.approved.txt
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 @@ | ||
one |
5 changes: 5 additions & 0 deletions
5
...s-tests-jdk8/src/test/java/org/approvaltests/ApprovalsTest.verifyAllTemplate.approved.txt
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,5 @@ | ||
TITLE | ||
|
||
|
||
placeholder input.value1 | ||
placeholder input.value2 |
13 changes: 13 additions & 0 deletions
13
approvaltests-tests-jdk8/src/test/resources/org/approvaltests/writers/query.csv
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,13 @@ | ||
pkey,name,occupation,company_name,email,phone_number,fax_number,web_site,address,status,add_date | ||
1,Wayne Santos,Software Consultant,Software Consultant Inc.,browndeborah@madden.com,953.398.7319x597,225-064-9143,http://figueroa.org/,"35606 Todd Rapids | ||
Jacobhaven, MO 53584",Active,00:00.0 | ||
2,Betty Fowler,Agile Programming Coach,Agile Programming Coach Inc.,sarah50@valdez.net,235-667-3404x1100,736-849-0453x5464,https://www.johnson.com/,"1877 Charles Throughway Suite 937 | ||
West Lisa, OK 48501",Active,00:00.0 | ||
3,Jeffrey Donaldson,Billiard Services,Billiards World,mollyfrancis@yahoo.com,001-064-126-6448x4270,192.351.2877,http://www.williams-jacobs.biz/,"6255 Shane Corners Apt. 562 | ||
Vaughnmouth, DC 36284",Inactive,00:00.0 | ||
4,Beth Fletcher,Acupuncturist,Acupuncturist Inc.,kristen77@yahoo.com,389.560.2184,001-854-076-8398x3895,https://www.brown-carter.com/,"USNV Gonzales | ||
FPO AE 11937",Active,00:00.0 | ||
5,John Wilson,Massage Therapist,Massage Therapist Inc.,robert48@yahoo.com,386-577-6329x76032,001-392-401-2439x63388,http://www.nguyen.com/,"93822 Colleen Rapid | ||
West Cindyton, NJ 76492",Inactive,00:00.0 | ||
6,Mark Holmes,Dentist,Dentist Inc.,sara93@hotmail.com,(722)410-5223x623,9532637336,https://webb.info/,"USS Long | ||
FPO AE 57539",Inactive,00:00.0 |
5 changes: 5 additions & 0 deletions
5
approvaltests-tests-jdk8/src/test/resources/org/approvaltests/writers/sample_result_set.csv
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,5 @@ | ||
pkey,name,age | ||
"1","Woody","35" | ||
"2","Llewellyn","15" | ||
"3","Dan","25" | ||
|
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