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