Added a lot of stuff

This commit is contained in:
hitanshu310 2025-02-02 01:12:22 +05:30
parent 3c3eee2e4d
commit a4ccbee99c
7 changed files with 20 additions and 13 deletions

View File

@ -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

View File

@ -15,6 +15,11 @@ dependencies {
implementation project(':module4')
implementation project(':module5')
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
test {
useJUnitPlatform()

View File

@ -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);
}

View File

@ -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);

View File

@ -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()
}

View File

@ -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() {

View File

@ -14,5 +14,4 @@ rootProject.name = 'Pricenton1'
include('module4')
include 'clients'
include 'module5'
include 'module5'