Ignore:
Timestamp:
07/14/15 11:43:55 (9 years ago)
Author:
sherbold
Message:
  • updated tests to allow configurable usage profiles through the properties
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-plugin-uml-test/src/test/java/de/ugoe/cs/autoquest/plugin/uml/UMLUtilsTest.java

    r1998 r2006  
    4141import de.ugoe.cs.autoquest.plugin.http.eventcore.SimpleSOAPEventType; 
    4242import de.ugoe.cs.autoquest.testgeneration.RandomWalkGenerator; 
    43 import de.ugoe.cs.autoquest.usageprofiles.FirstOrderMarkovModel; 
     43import de.ugoe.cs.autoquest.usageprofiles.HighOrderMarkovModel; 
    4444import de.ugoe.cs.autoquest.usageprofiles.IStochasticProcess; 
     45import de.ugoe.cs.autoquest.usageprofiles.TrieBasedModel; 
    4546import de.ugoe.cs.util.SerializationUtils; 
    4647import de.ugoe.cs.util.console.TextConsole; 
     
    274275        Properties properties = loadProperties(testdata); 
    275276        Collection<List<Event>> sequences = loadAndPreprocessUsageJournal(testdata, properties); 
    276         IStochasticProcess model = createUsageProfile(testdata, sequences); 
     277        IStochasticProcess model = createUsageProfile(testdata, properties, sequences); 
    277278        byte[] serialized = SerializationUtils.serialize(model); 
    278279        SerializationUtils.deserialize(serialized); 
     
    324325            ModelUtils.loadModel(new File(ClassLoader.getSystemResource(testdata.dslModelFile) 
    325326                .getFile())); 
    326         IStochasticProcess usageProfile = createUsageProfile(testdata, sequences); 
     327        IStochasticProcess usageProfile = createUsageProfile(testdata, properties, sequences); 
    327328        Collection<List<Event>> generatedSequences = 
    328329            createRandomSequences(usageProfile, properties); 
     
    353354            ModelUtils.loadModel(new File(ClassLoader.getSystemResource(testdata.dslModelFile) 
    354355                .getFile())); 
    355         IStochasticProcess usageProfile = createUsageProfile(testdata, sequences); 
     356        IStochasticProcess usageProfile = createUsageProfile(testdata, properties, sequences); 
    356357        Collection<List<Event>> generatedSequences = 
    357358            createRandomSequences(usageProfile, properties); 
     
    400401    } 
    401402 
    402     private IStochasticProcess createUsageProfile(TestData testdata, 
     403    private IStochasticProcess createUsageProfile(TestData testdata, Properties properties, 
    403404                                                  Collection<List<Event>> sequences) 
    404405        throws Exception 
    405406    { 
    406         FirstOrderMarkovModel usageProfile = new FirstOrderMarkovModel(new Random(1)); 
     407        TrieBasedModel usageProfile = new HighOrderMarkovModel(Integer.parseInt(properties.getProperty("usageprofile.markovorder", "1")), new Random(1)); 
    407408        usageProfile.train(sequences); 
    408409        FileOutputStream fos = new FileOutputStream(OUTPUT_DIR + testdata.usageProfileFile); 
Note: See TracChangeset for help on using the changeset viewer.