commit
1b90acf496
@ -33,9 +33,7 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
|
|||||||
|
|
||||||
|
|
||||||
public BodyTube() {
|
public BodyTube() {
|
||||||
super();
|
this(8 * DEFAULT_RADIUS, DEFAULT_RADIUS);
|
||||||
this.length = 8 * DEFAULT_RADIUS;
|
|
||||||
this.outerRadius = DEFAULT_RADIUS;
|
|
||||||
this.autoRadius = true;
|
this.autoRadius = true;
|
||||||
|
|
||||||
this.motorConfigurations = new MotorFlightConfigurationImpl<MotorConfiguration>(this, ComponentChangeEvent.MOTOR_CHANGE, MotorConfiguration.NO_MOTORS);
|
this.motorConfigurations = new MotorFlightConfigurationImpl<MotorConfiguration>(this, ComponentChangeEvent.MOTOR_CHANGE, MotorConfiguration.NO_MOTORS);
|
||||||
@ -46,6 +44,8 @@ public class BodyTube extends SymmetricComponent implements MotorMount, Coaxial
|
|||||||
super();
|
super();
|
||||||
this.outerRadius = Math.max(radius, 0);
|
this.outerRadius = Math.max(radius, 0);
|
||||||
this.length = Math.max(length, 0);
|
this.length = Math.max(length, 0);
|
||||||
|
this.motorConfigurations = new MotorFlightConfigurationImpl<MotorConfiguration>(this, ComponentChangeEvent.MOTOR_CHANGE, MotorConfiguration.NO_MOTORS);
|
||||||
|
this.ignitionConfigurations = new FlightConfigurationImpl<IgnitionConfiguration>(this, ComponentChangeEvent.EVENT_CHANGE, new IgnitionConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -426,6 +426,7 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab
|
|||||||
*/
|
*/
|
||||||
public void setAppearance(Appearance appearance) {
|
public void setAppearance(Appearance appearance) {
|
||||||
this.appearance = appearance;
|
this.appearance = appearance;
|
||||||
|
if (this.appearance != null) {
|
||||||
Decal d = this.appearance.getTexture();
|
Decal d = this.appearance.getTexture();
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
d.getImage().addChangeListener(new StateChangeListener() {
|
d.getImage().addChangeListener(new StateChangeListener() {
|
||||||
@ -437,6 +438,8 @@ public abstract class RocketComponent implements ChangeSource, Cloneable, Iterab
|
|||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// CHECK - should this be a TEXTURE_CHANGE and not NONFUNCTIONAL_CHANGE?
|
||||||
fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
|
fireComponentChangeEvent(ComponentChangeEvent.NONFUNCTIONAL_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
32
core/test/net/sf/openrocket/BaseApplicationAbstractTest.java
Normal file
32
core/test/net/sf/openrocket/BaseApplicationAbstractTest.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package net.sf.openrocket;
|
||||||
|
|
||||||
|
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||||
|
import net.sf.openrocket.plugin.PluginModule;
|
||||||
|
import net.sf.openrocket.startup.Application;
|
||||||
|
import net.sf.openrocket.startup.ApplicationModule;
|
||||||
|
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
|
||||||
|
import com.google.inject.Guice;
|
||||||
|
import com.google.inject.Injector;
|
||||||
|
import com.google.inject.Module;
|
||||||
|
|
||||||
|
|
||||||
|
public abstract class BaseApplicationAbstractTest {
|
||||||
|
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setUp() throws Exception {
|
||||||
|
Application.setInjector(initializeGuice());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Injector initializeGuice() {
|
||||||
|
Application.setPreferences(new SwingPreferences());
|
||||||
|
|
||||||
|
Module applicationModule = new ApplicationModule();
|
||||||
|
Module pluginModule = new PluginModule();
|
||||||
|
|
||||||
|
return Guice.createInjector(applicationModule, pluginModule);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -16,7 +16,6 @@ import javax.swing.Action;
|
|||||||
import net.sf.openrocket.aerodynamics.AerodynamicCalculator;
|
import net.sf.openrocket.aerodynamics.AerodynamicCalculator;
|
||||||
import net.sf.openrocket.aerodynamics.BarrowmanCalculator;
|
import net.sf.openrocket.aerodynamics.BarrowmanCalculator;
|
||||||
import net.sf.openrocket.aerodynamics.FlightConditions;
|
import net.sf.openrocket.aerodynamics.FlightConditions;
|
||||||
import net.sf.openrocket.database.motor.MotorDatabase;
|
|
||||||
import net.sf.openrocket.database.motor.ThrustCurveMotorSetDatabase;
|
import net.sf.openrocket.database.motor.ThrustCurveMotorSetDatabase;
|
||||||
import net.sf.openrocket.document.OpenRocketDocument;
|
import net.sf.openrocket.document.OpenRocketDocument;
|
||||||
import net.sf.openrocket.document.Simulation;
|
import net.sf.openrocket.document.Simulation;
|
||||||
@ -38,32 +37,27 @@ import net.sf.openrocket.rocketcomponent.RocketComponent;
|
|||||||
import net.sf.openrocket.simulation.FlightDataType;
|
import net.sf.openrocket.simulation.FlightDataType;
|
||||||
import net.sf.openrocket.simulation.exception.SimulationException;
|
import net.sf.openrocket.simulation.exception.SimulationException;
|
||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
|
import net.sf.openrocket.startup.ApplicationModule2;
|
||||||
import net.sf.openrocket.util.Coordinate;
|
import net.sf.openrocket.util.Coordinate;
|
||||||
import net.sf.openrocket.util.BaseTestCase.BaseTestCase;
|
|
||||||
|
|
||||||
import org.jmock.Expectations;
|
|
||||||
import org.jmock.Mockery;
|
import org.jmock.Mockery;
|
||||||
import org.jmock.auto.Mock;
|
|
||||||
import org.jmock.integration.junit4.JMock;
|
import org.jmock.integration.junit4.JMock;
|
||||||
import org.jmock.integration.junit4.JUnit4Mockery;
|
import org.jmock.integration.junit4.JUnit4Mockery;
|
||||||
import org.junit.Before;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
|
import com.google.inject.Provider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class contains various integration tests that simulate user actions that
|
* This class contains various integration tests that simulate user actions that
|
||||||
* might be performed.
|
* might be performed.
|
||||||
*/
|
*/
|
||||||
@RunWith(JMock.class)
|
@RunWith(JMock.class)
|
||||||
public class IntegrationTest extends BaseTestCase {
|
public class IntegrationTest extends BaseApplicationAbstractTest {
|
||||||
Mockery context = new JUnit4Mockery();
|
Mockery context = new JUnit4Mockery();
|
||||||
|
|
||||||
@Mock
|
|
||||||
Injector injector;
|
|
||||||
|
|
||||||
|
|
||||||
private OpenRocketDocument document;
|
private OpenRocketDocument document;
|
||||||
private Action undoAction, redoAction;
|
private Action undoAction, redoAction;
|
||||||
|
|
||||||
@ -72,22 +66,27 @@ public class IntegrationTest extends BaseTestCase {
|
|||||||
private Configuration config;
|
private Configuration config;
|
||||||
private FlightConditions conditions;
|
private FlightConditions conditions;
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void setupMotorDatabase() {
|
||||||
|
|
||||||
@Before
|
|
||||||
public void initialize() {
|
|
||||||
final ThrustCurveMotorSetDatabase db = new ThrustCurveMotorSetDatabase();
|
final ThrustCurveMotorSetDatabase db = new ThrustCurveMotorSetDatabase();
|
||||||
db.addMotor(readMotor());
|
db.addMotor(readMotor());
|
||||||
|
|
||||||
context.checking(new Expectations() {
|
|
||||||
{
|
|
||||||
allowing(injector).getInstance(MotorDatabase.class);
|
|
||||||
will(returnValue(db));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
assertEquals(1, db.getMotorSets().size());
|
assertEquals(1, db.getMotorSets().size());
|
||||||
Application.setInjector(injector);
|
|
||||||
|
ApplicationModule2 module = new ApplicationModule2(new Provider<ThrustCurveMotorSetDatabase>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ThrustCurveMotorSetDatabase get() {
|
||||||
|
return db;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
Injector injector2 = Application.getInjector().createChildInjector(module);
|
||||||
|
Application.setInjector(injector2);
|
||||||
Application.setBaseTranslator(new ResourceBundleTranslator("l10n.messages"));
|
Application.setBaseTranslator(new ResourceBundleTranslator("l10n.messages"));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ThrustCurveMotor readMotor() {
|
private static ThrustCurveMotor readMotor() {
|
||||||
|
@ -8,6 +8,7 @@ import java.io.BufferedInputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import net.sf.openrocket.BaseApplicationAbstractTest;
|
||||||
import net.sf.openrocket.document.OpenRocketDocument;
|
import net.sf.openrocket.document.OpenRocketDocument;
|
||||||
import net.sf.openrocket.document.OpenRocketDocumentFactory;
|
import net.sf.openrocket.document.OpenRocketDocumentFactory;
|
||||||
import net.sf.openrocket.file.DatabaseMotorFinder;
|
import net.sf.openrocket.file.DatabaseMotorFinder;
|
||||||
@ -23,7 +24,7 @@ import org.junit.Assert;
|
|||||||
/**
|
/**
|
||||||
* RocksimLoader Tester.
|
* RocksimLoader Tester.
|
||||||
*/
|
*/
|
||||||
public class RocksimLoaderTest {
|
public class RocksimLoaderTest extends BaseApplicationAbstractTest {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test a bug reported via automated bug report. I have been unable to reproduce this bug
|
* Test a bug reported via automated bug report. I have been unable to reproduce this bug
|
||||||
@ -83,7 +84,7 @@ public class RocksimLoaderTest {
|
|||||||
//Do some simple asserts; the important thing here is just validating that the mass and cg were
|
//Do some simple asserts; the important thing here is just validating that the mass and cg were
|
||||||
//not overridden for each stage.
|
//not overridden for each stage.
|
||||||
Assert.assertEquals("Three Stage Everything Included Rocket", doc.getRocket().getName());
|
Assert.assertEquals("Three Stage Everything Included Rocket", doc.getRocket().getName());
|
||||||
Assert.assertEquals(1, loader.getWarnings().size());
|
Assert.assertEquals(0, loader.getWarnings().size());
|
||||||
Assert.assertEquals(3, rocket.getStageCount());
|
Assert.assertEquals(3, rocket.getStageCount());
|
||||||
Stage stage1 = (Stage) rocket.getChild(0);
|
Stage stage1 = (Stage) rocket.getChild(0);
|
||||||
Assert.assertFalse(stage1.isMassOverridden());
|
Assert.assertFalse(stage1.isMassOverridden());
|
||||||
|
@ -3,28 +3,21 @@
|
|||||||
*/
|
*/
|
||||||
package net.sf.openrocket.file.rocksim.importt;
|
package net.sf.openrocket.file.rocksim.importt;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.sf.openrocket.BaseApplicationAbstractTest;
|
||||||
import net.sf.openrocket.gui.util.SwingPreferences;
|
import net.sf.openrocket.gui.util.SwingPreferences;
|
||||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A base class for the Rocksim tests. Includes code from the junitx.addons project.
|
* A base class for the Rocksim tests. Includes code from the junitx.addons project.
|
||||||
*/
|
*/
|
||||||
public abstract class RocksimTestBase {
|
public abstract class RocksimTestBase extends BaseApplicationAbstractTest {
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see junit.framework.TestCase#setUp()
|
|
||||||
*/
|
|
||||||
@Before
|
|
||||||
public void setUp() throws Exception {
|
|
||||||
Application.setPreferences( new SwingPreferences() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void assertContains(RocketComponent child, List<RocketComponent> components) {
|
public void assertContains(RocketComponent child, List<RocketComponent> components) {
|
||||||
Assert.assertTrue("Components did not contain child", components.contains(child));
|
Assert.assertTrue("Components did not contain child", components.contains(child));
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package net.sf.openrocket.optimization.rocketoptimization;
|
package net.sf.openrocket.optimization.rocketoptimization;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import net.sf.openrocket.BaseApplicationAbstractTest;
|
||||||
import net.sf.openrocket.document.Simulation;
|
import net.sf.openrocket.document.Simulation;
|
||||||
import net.sf.openrocket.optimization.general.OptimizationException;
|
import net.sf.openrocket.optimization.general.OptimizationException;
|
||||||
import net.sf.openrocket.optimization.general.Point;
|
import net.sf.openrocket.optimization.general.Point;
|
||||||
@ -20,7 +23,7 @@ import org.junit.runner.RunWith;
|
|||||||
|
|
||||||
|
|
||||||
@RunWith(JMock.class)
|
@RunWith(JMock.class)
|
||||||
public class TestRocketOptimizationFunction {
|
public class TestRocketOptimizationFunction extends BaseApplicationAbstractTest {
|
||||||
Mockery context = new JUnit4Mockery();
|
Mockery context = new JUnit4Mockery();
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
@ -51,22 +54,32 @@ public class TestRocketOptimizationFunction {
|
|||||||
final Point point = new Point(p1, p2);
|
final Point point = new Point(p1, p2);
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {
|
||||||
|
{
|
||||||
oneOf(modifier1).modify(simulation, p1);
|
oneOf(modifier1).modify(simulation, p1);
|
||||||
oneOf(modifier2).modify(simulation, p2);
|
oneOf(modifier2).modify(simulation, p2);
|
||||||
oneOf(domain).getDistanceToDomain(simulation); will(returnValue(new Pair<Double,Value>(ddist, dref)));
|
oneOf(domain).getDistanceToDomain(simulation);
|
||||||
oneOf(parameter).computeValue(simulation); will(returnValue(pvalue));
|
will(returnValue(new Pair<Double, Value>(ddist, dref)));
|
||||||
oneOf(parameter).getUnitGroup(); will(returnValue(UnitGroup.UNITS_NONE));
|
oneOf(parameter).computeValue(simulation);
|
||||||
oneOf(goal).getMinimizationParameter(pvalue); will(returnValue(gvalue));
|
will(returnValue(pvalue));
|
||||||
oneOf(modifier1).getCurrentSIValue(simulation); will(returnValue(0.2));
|
oneOf(parameter).getUnitGroup();
|
||||||
oneOf(modifier1).getUnitGroup(); will(returnValue(UnitGroup.UNITS_LENGTH));
|
will(returnValue(UnitGroup.UNITS_NONE));
|
||||||
oneOf(modifier2).getCurrentSIValue(simulation); will(returnValue(0.3));
|
oneOf(goal).getMinimizationParameter(pvalue);
|
||||||
oneOf(modifier2).getUnitGroup(); will(returnValue(UnitGroup.UNITS_LENGTH));
|
will(returnValue(gvalue));
|
||||||
|
oneOf(modifier1).getCurrentSIValue(simulation);
|
||||||
|
will(returnValue(0.2));
|
||||||
|
oneOf(modifier1).getUnitGroup();
|
||||||
|
will(returnValue(UnitGroup.UNITS_LENGTH));
|
||||||
|
oneOf(modifier2).getCurrentSIValue(simulation);
|
||||||
|
will(returnValue(0.3));
|
||||||
|
oneOf(modifier2).getUnitGroup();
|
||||||
|
will(returnValue(UnitGroup.UNITS_LENGTH));
|
||||||
oneOf(listener).evaluated(point, new Value[] {
|
oneOf(listener).evaluated(point, new Value[] {
|
||||||
new Value(0.2, UnitGroup.UNITS_LENGTH.getDefaultUnit()),
|
new Value(0.2, UnitGroup.UNITS_LENGTH.getDefaultUnit()),
|
||||||
new Value(0.3, UnitGroup.UNITS_LENGTH.getDefaultUnit())
|
new Value(0.3, UnitGroup.UNITS_LENGTH.getDefaultUnit())
|
||||||
}, dref, pvalueValue, gvalue);
|
}, dref, pvalueValue, gvalue);
|
||||||
}});
|
}
|
||||||
|
});
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
RocketOptimizationFunction function = new RocketOptimizationFunction(simulation,
|
RocketOptimizationFunction function = new RocketOptimizationFunction(simulation,
|
||||||
@ -94,14 +107,20 @@ public class TestRocketOptimizationFunction {
|
|||||||
final double pvalue = 9.81;
|
final double pvalue = 9.81;
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {
|
||||||
|
{
|
||||||
oneOf(modifier1).modify(simulation, p1);
|
oneOf(modifier1).modify(simulation, p1);
|
||||||
oneOf(modifier2).modify(simulation, p2);
|
oneOf(modifier2).modify(simulation, p2);
|
||||||
oneOf(domain).getDistanceToDomain(simulation); will(returnValue(new Pair<Double,Value>(ddist, dref)));
|
oneOf(domain).getDistanceToDomain(simulation);
|
||||||
oneOf(parameter).computeValue(simulation); will(returnValue(pvalue));
|
will(returnValue(new Pair<Double, Value>(ddist, dref)));
|
||||||
oneOf(parameter).getUnitGroup(); will(returnValue(UnitGroup.UNITS_NONE));
|
oneOf(parameter).computeValue(simulation);
|
||||||
oneOf(goal).getMinimizationParameter(pvalue); will(returnValue(Double.NaN));
|
will(returnValue(pvalue));
|
||||||
}});
|
oneOf(parameter).getUnitGroup();
|
||||||
|
will(returnValue(UnitGroup.UNITS_NONE));
|
||||||
|
oneOf(goal).getMinimizationParameter(pvalue);
|
||||||
|
will(returnValue(Double.NaN));
|
||||||
|
}
|
||||||
|
});
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
|
|
||||||
@ -131,19 +150,26 @@ public class TestRocketOptimizationFunction {
|
|||||||
final Point point = new Point(p1, p2);
|
final Point point = new Point(p1, p2);
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {
|
||||||
|
{
|
||||||
oneOf(modifier1).modify(simulation, p1);
|
oneOf(modifier1).modify(simulation, p1);
|
||||||
oneOf(modifier2).modify(simulation, p2);
|
oneOf(modifier2).modify(simulation, p2);
|
||||||
oneOf(domain).getDistanceToDomain(simulation); will(returnValue(new Pair<Double,Value>(ddist, dref)));
|
oneOf(domain).getDistanceToDomain(simulation);
|
||||||
oneOf(modifier1).getCurrentSIValue(simulation); will(returnValue(0.2));
|
will(returnValue(new Pair<Double, Value>(ddist, dref)));
|
||||||
oneOf(modifier1).getUnitGroup(); will(returnValue(UnitGroup.UNITS_LENGTH));
|
oneOf(modifier1).getCurrentSIValue(simulation);
|
||||||
oneOf(modifier2).getCurrentSIValue(simulation); will(returnValue(0.3));
|
will(returnValue(0.2));
|
||||||
oneOf(modifier2).getUnitGroup(); will(returnValue(UnitGroup.UNITS_LENGTH));
|
oneOf(modifier1).getUnitGroup();
|
||||||
|
will(returnValue(UnitGroup.UNITS_LENGTH));
|
||||||
|
oneOf(modifier2).getCurrentSIValue(simulation);
|
||||||
|
will(returnValue(0.3));
|
||||||
|
oneOf(modifier2).getUnitGroup();
|
||||||
|
will(returnValue(UnitGroup.UNITS_LENGTH));
|
||||||
oneOf(listener).evaluated(point, new Value[] {
|
oneOf(listener).evaluated(point, new Value[] {
|
||||||
new Value(0.2, UnitGroup.UNITS_LENGTH.getDefaultUnit()),
|
new Value(0.2, UnitGroup.UNITS_LENGTH.getDefaultUnit()),
|
||||||
new Value(0.3, UnitGroup.UNITS_LENGTH.getDefaultUnit())
|
new Value(0.3, UnitGroup.UNITS_LENGTH.getDefaultUnit())
|
||||||
}, dref, null, 1.98E200);
|
}, dref, null, 1.98E200);
|
||||||
}});
|
}
|
||||||
|
});
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
|
|
||||||
@ -171,11 +197,14 @@ public class TestRocketOptimizationFunction {
|
|||||||
final Value dref = new Value(0.33, Unit.NOUNIT);
|
final Value dref = new Value(0.33, Unit.NOUNIT);
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {
|
||||||
|
{
|
||||||
oneOf(modifier1).modify(simulation, p1);
|
oneOf(modifier1).modify(simulation, p1);
|
||||||
oneOf(modifier2).modify(simulation, p2);
|
oneOf(modifier2).modify(simulation, p2);
|
||||||
oneOf(domain).getDistanceToDomain(simulation); will(returnValue(new Pair<Double,Value>(ddist, dref)));
|
oneOf(domain).getDistanceToDomain(simulation);
|
||||||
}});
|
will(returnValue(new Pair<Double, Value>(ddist, dref)));
|
||||||
|
}
|
||||||
|
});
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package net.sf.openrocket.optimization.rocketoptimization.modifiers;
|
|||||||
|
|
||||||
import static net.sf.openrocket.util.MathUtil.EPSILON;
|
import static net.sf.openrocket.util.MathUtil.EPSILON;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import net.sf.openrocket.BaseApplicationAbstractTest;
|
||||||
import net.sf.openrocket.document.Simulation;
|
import net.sf.openrocket.document.Simulation;
|
||||||
import net.sf.openrocket.optimization.general.OptimizationException;
|
import net.sf.openrocket.optimization.general.OptimizationException;
|
||||||
import net.sf.openrocket.rocketcomponent.Rocket;
|
import net.sf.openrocket.rocketcomponent.Rocket;
|
||||||
@ -11,7 +12,7 @@ import org.junit.Assert;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class TestGenericModifier {
|
public class TestGenericModifier extends BaseApplicationAbstractTest {
|
||||||
|
|
||||||
private TestValue value;
|
private TestValue value;
|
||||||
private GenericModifier<TestValue> gm;
|
private GenericModifier<TestValue> gm;
|
||||||
|
@ -18,7 +18,10 @@ public class ComponentCompare {
|
|||||||
private static final String[] IGNORED_METHODS = {
|
private static final String[] IGNORED_METHODS = {
|
||||||
"getClass", "getChildCount", "getChildren", "getNextComponent", "getID",
|
"getClass", "getChildCount", "getChildren", "getNextComponent", "getID",
|
||||||
"getPreviousComponent", "getParent", "getRocket", "getRoot", "getStage",
|
"getPreviousComponent", "getParent", "getRocket", "getRoot", "getStage",
|
||||||
"getStageNumber", "getComponentName", "getDefaultFlightConfiguration",
|
"getStageNumber", "getComponentName",
|
||||||
|
"getStageSeparationConfiguration",
|
||||||
|
"getMotorConfiguration",
|
||||||
|
"getIgnitionConfiguration",
|
||||||
// Rocket specific methods:
|
// Rocket specific methods:
|
||||||
"getModID", "getMassModID", "getAerodynamicModID", "getTreeModID", "getFunctionalModID",
|
"getModID", "getMassModID", "getAerodynamicModID", "getTreeModID", "getFunctionalModID",
|
||||||
"getFlightConfigurationIDs", "getDefaultConfiguration", "getMotorMounts"
|
"getFlightConfigurationIDs", "getDefaultConfiguration", "getMotorMounts"
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package net.sf.openrocket.simulation.customexpression;
|
package net.sf.openrocket.simulation.customexpression;
|
||||||
|
|
||||||
|
import net.sf.openrocket.BaseApplicationAbstractTest;
|
||||||
import net.sf.openrocket.document.OpenRocketDocument;
|
import net.sf.openrocket.document.OpenRocketDocument;
|
||||||
import net.sf.openrocket.document.OpenRocketDocumentFactory;
|
import net.sf.openrocket.document.OpenRocketDocumentFactory;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
public class TestExpressions {
|
public class TestExpressions extends BaseApplicationAbstractTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExpressions() {
|
public void testExpressions() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user