forked from Hithomelabs/Princeton1
Added a lot of stuff
This commit is contained in:
parent
3c3eee2e4d
commit
a4ccbee99c
@ -16,7 +16,7 @@ jobs:
|
|||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
java-version: '21'
|
java-version: '11'
|
||||||
- name: Validate Gradle Wrapper
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/actions/wrapper-validation@v3
|
uses: gradle/actions/wrapper-validation@v3
|
||||||
- name: Gradle build
|
- name: Gradle build
|
||||||
|
@ -15,6 +15,11 @@ dependencies {
|
|||||||
implementation project(':module4')
|
implementation project(':module4')
|
||||||
implementation project(':module5')
|
implementation project(':module5')
|
||||||
}
|
}
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(11)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
|
@ -20,14 +20,6 @@ public class InsertionClient {
|
|||||||
//* * Sample output
|
//* * Sample output
|
||||||
for (int i = 0; i < apples.length; i++)
|
for (int i = 0; i < apples.length; i++)
|
||||||
System.out.println(apples[i]);
|
System.out.println(apples[i]);
|
||||||
|
|
||||||
oranges[0] = new Orange(4);
|
|
||||||
oranges[1] = new Orange(1);
|
|
||||||
// * Should give runtime exception as ClassCastException is a runtime exception
|
|
||||||
//insertion.sort(oranges);
|
|
||||||
Insertion<Orange> selection2 = new Insertion<>();
|
|
||||||
// * Should result in a compile time exception, as casting to Orange will fail
|
|
||||||
//selection2.sort(apples);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public class SelectionClient {
|
|||||||
oranges[0] = new Orange(4);
|
oranges[0] = new Orange(4);
|
||||||
oranges[1] = new Orange(1);
|
oranges[1] = new Orange(1);
|
||||||
// * Should give runtime exception as ClassCastException is a runtime exception
|
// * Should give runtime exception as ClassCastException is a runtime exception
|
||||||
//insertion.sort(oranges);
|
//selection.sort(oranges);
|
||||||
Selection<Orange> selection2 = new Selection<Orange>();
|
Selection<Orange> selection2 = new Selection<Orange>();
|
||||||
// * Should result in a compile time exception, as casting to Orange will fail
|
// * Should result in a compile time exception, as casting to Orange will fail
|
||||||
//selection2.sort(apples);
|
//selection2.sort(apples);
|
||||||
|
@ -13,7 +13,11 @@ dependencies {
|
|||||||
testImplementation platform('org.junit:junit-bom:5.10.0')
|
testImplementation platform('org.junit:junit-bom:5.10.0')
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter'
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||||
}
|
}
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(11)
|
||||||
|
}
|
||||||
|
}
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
@ -10,7 +10,7 @@ import java.util.Random;
|
|||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
class InsertionTest {
|
class SortTest {
|
||||||
|
|
||||||
private ArrayList<Apple> apples;
|
private ArrayList<Apple> apples;
|
||||||
private AbstractCustomSorts<Apple> sortingAlgorithm;
|
private AbstractCustomSorts<Apple> sortingAlgorithm;
|
||||||
@ -47,6 +47,13 @@ class InsertionTest {
|
|||||||
testSort(sortingAlgorithm);
|
testSort(sortingAlgorithm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Testing Shell sort functionality")
|
||||||
|
public void testShellSort() {
|
||||||
|
sortingAlgorithm = new Shell<>();
|
||||||
|
testSort(sortingAlgorithm);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
void tearDown() {
|
void tearDown() {
|
||||||
|
@ -14,5 +14,4 @@ rootProject.name = 'Pricenton1'
|
|||||||
include('module4')
|
include('module4')
|
||||||
include 'clients'
|
include 'clients'
|
||||||
include 'module5'
|
include 'module5'
|
||||||
include 'module5'
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user