/** * The package were third-party libraries are shaded into * @return */ public static String getShadedPackageForThirdPartyLibraries(){ return getEvoSuitePackage() + "." +SHADED; }
/** Constructor */ private Properties(boolean loadProperties, boolean silent) { if (loadProperties) loadProperties(silent); setClassPrefix(); }
private void init() { state = ClientState.NOT_STARTED; clientStartTime = 0; timeLeftFromPreviousPhases = 0; initializePhaseTimeouts(); }
/** * <p> * Constructor for BranchCoverageSuiteFitness. * </p> */ public BranchCoverageSuiteFitness() { this(TestGenerationContext.getInstance().getClassLoaderForSUT()); }
@Override public void evosuite_updateProperty(String clientRmiIdentifier, String propertyName, Object value) throws RemoteException, IllegalArgumentException, IllegalAccessException, NoSuchParameterException { Properties.getInstance().setValue(propertyName, value); }
public RegressionTestChromosome() { // TODO Auto-generated constructor stub theClassLoader = TestGenerationContext.getInstance().getRegressionClassLoaderForSUT(); }
/** * @deprecated use {@code getInstance().getClassLoaderForSUT()} * * @return */ public static ClassLoader getClassLoader() { return getInstance().classLoader; }
/** * Load and initialize a properties file from a given path * * @param propertiesPath * a {@link java.lang.String} object. */ public void loadProperties(String propertiesPath, boolean silent) { loadPropertiesFile(propertiesPath, silent); initializeProperties(); }
@Override public void zero() { this.value = Properties.getTargetClassAndDontInitialise(); }
/** * Singleton accessor * * @return a {@link org.evosuite.Properties} object. */ public static Properties getInstance() { if (instance == null) instance = new Properties(true, false); return instance; }
/** * Returns the target class. It required, it also executes the * <clinit> class initialiser of the target class * * @return the initialised target class */ public static Class<?> getInitializedTargetClass() { return getTargetClass(true); }
/** * Is there time to execute a test case? * This not only depends on which phase we are in, but * also on how maximum long a test case can be left run * before trying to kill its threads if timeout. * * @return */ public synchronized boolean hasTimeToExecuteATestCase(){ return isThereStillTimeInThisPhase(Properties.TIMEOUT); }
private int calculateNumberOfIntervals() { long interval = Properties.TIMELINE_INTERVAL; /* * We cannot just look at the obtained history, because the search might * have finished earlier, eg if 100% coverage */ long totalTime = TimeController.getSearchBudgetInSeconds() * 1000l; int numberOfIntervals = (int) (totalTime / interval); return numberOfIntervals; } }
@Override public void run() { /* * NOTE: the handling of the parameters "-D" should be handled * directly in JUnit by setting the different values in Properties */ ClientProcess.main(new String[0]); } };
/** * Main and only constructor */ protected TimeController(){ init(); }
/** * * @param testSuite * the test cases which should be written to file */ public static TestGenerationResult writeJUnitTestsAndCreateResult(TestSuiteChromosome testSuite) { return writeJUnitTestsAndCreateResult(testSuite, Properties.JUNIT_SUFFIX); }
private static String[] getEvoSuitePackages() { return new String[] { PackageInfo.getEvoSuitePackage(), "org.exsyst", "de.unisb.cs.st.testcarver", "de.unisb.cs.st.evosuite", "testing.generation.evosuite", "de.unisl.cs.st.bugex" }; }
/** * Singleton accessor * * @return a {@link org.evosuite.Properties} object. */ public static Properties getInstanceSilent() { if (instance == null) instance = new Properties(true, true); return instance; }
/** * Returns the target class. If the class is not yet initialised, * this method *does not* execute the <clinit> class initialiser of the target class. * This method explicitly states that the <clinit> method is not executed * because of this method. * * @return the target class. The target class could be uninitialised */ public static Class<?> getTargetClassAndDontInitialise() { return getTargetClass(false); }
public synchronized boolean isThereStillTimeInThisPhase(){ return isThereStillTimeInThisPhase(1); }