2021-04-20 15:15:10 +02:00
|
|
|
package lsystem;
|
|
|
|
|
|
|
|
import lsystem.engine.Parser;
|
|
|
|
import lsystem.screen.gl3d.GLCanvas;
|
|
|
|
import lsystem.utils.Pair;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertNotNull;
|
|
|
|
|
|
|
|
public class StressTest {
|
|
|
|
|
|
|
|
/**
|
2021-04-20 15:23:22 +02:00
|
|
|
* require at least 3GB of free ram
|
2021-04-20 15:15:10 +02:00
|
|
|
*/
|
|
|
|
@Test
|
|
|
|
public void stressTest1() {
|
|
|
|
long millis = System.currentTimeMillis();
|
|
|
|
GLCanvas joglFrame = new GLCanvas();
|
2021-04-20 15:23:22 +02:00
|
|
|
Parser parser = new Parser("Y", Arrays.asList("Y=X+[[Y]-Y]-X[-XY]+Y", "X=XX"), 11);
|
2021-04-20 15:15:10 +02:00
|
|
|
List<Pair<String, String>> lSystemRules = parser.parseRules();
|
|
|
|
joglFrame.setLSystem(parser.getAxiom(), lSystemRules, parser.getNbIterations());
|
|
|
|
System.out.println(joglFrame.getLSystem());
|
|
|
|
System.out.println("time in millisecondes: " + (System.currentTimeMillis() - millis));
|
|
|
|
assertNotNull("L-System should not be null", joglFrame.getLSystem());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|