Skip to content

Commit

Permalink
Add basic test and JUnit dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-shettyy committed Mar 13, 2024
1 parent ab30101 commit 3e920db
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ replay_pid*

# Ignore Gradle build output directory
build

# Ignore vscode settings
.vscode
18 changes: 16 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,18 @@ plugins {
}

repositories {
// Snapshot repository for JSpecify conformance test framework
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots'}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/'}
mavenCentral()
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 1.9
targetCompatibility = 1.9

configurations {
jSpecifyConformanceTests
}

dependencies {
// Use JUnit Jupiter for testing.
Expand All @@ -28,6 +35,9 @@ dependencies {

// This dependency is used by the application.
implementation 'com.google.guava:guava:31.1-jre'

testImplementation 'org.jspecify.conformance:conformance-test-framework:0.0.0-SNAPSHOT'
jSpecifyConformanceTests 'org.jspecify.conformance:conformance-tests:0.0.0-SNAPSHOT'
}

spotless {
Expand All @@ -53,4 +63,8 @@ spotless {
}
}

test {
useJUnitPlatform()
}

mainClassName = 'hello.HelloWorld'
Binary file not shown.
12 changes: 12 additions & 0 deletions src/test/java/conformance/HelloWorldTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package conformance;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

public class HelloWorldTest {
@Test
public void testHelloWorld() {
assertEquals("Hello, World!", "Hello, World!");
}
}

0 comments on commit 3e920db

Please sign in to comment.