Put testsuite in its own directory

This commit is contained in:
ktkk 2026-07-06 11:28:58 +00:00
parent 0cf25ebaf4
commit 114b9b099c
16 changed files with 107 additions and 0 deletions

View file

@ -0,0 +1,10 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface CustomAttribute {
}

View file

@ -0,0 +1,6 @@
class Hello {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}

View file

@ -0,0 +1,10 @@
public interface Interface {
String getName();
default void sayHello() {
System.out.println("Hello " + getName());
}
}

View file

@ -0,0 +1,41 @@
import java.util.function.Supplier;
@CustomAttribute
public class Main implements Runnable, Supplier<Integer>, Interface {
private static final String name = "John";
private static final int number = 42;
private static final double funnyNumber = 6.9;
public static void main() {
new Main().sayHello();
}
@Override
public void run() {
Main.main();
}
@Override
public Integer get() {
return number;
}
@Override
public String getName() {
return name;
}
public void throwSomething() throws Throwable {
throw new Throwable() {
@Override
public String getMessage() {
return "Hello";
}
};
}
public static class Inner {
private static final String name = "Inner John";
}
}

View file

@ -0,0 +1,22 @@
import java.util.concurrent.Executors;
import java.util.stream.IntStream;
import java.util.concurrent.TimeUnit;
public class MultiThreading {
private int number = 0;
public static void main(String[] args) throws InterruptedException {
final var multiThreading = new MultiThreading();
final var service = Executors.newFixedThreadPool(3);
IntStream.range(0, 1000)
.forEach(count -> service.submit(multiThreading::increment));
service.awaitTermination(1000, TimeUnit.MILLISECONDS);
System.out.println(multiThreading.number);
}
public synchronized void increment() {
number += 1;
}
}

Binary file not shown.

View file

@ -0,0 +1,12 @@
fun main() {
println("Hello, world!")
Test().apply {
test = true
}
}
class Test {
var test: Boolean = false
}