Skip to content
Snippets Groups Projects
Commit 52bf8a83 authored by Christian Wulf's avatar Christian Wulf
Browse files

Merge remote-tracking branch 'origin/test-configuration'

Conflicts:
	src/main/java/teetime/stage/kieker/Dir2RecordsFilter.java
parents 253daf13 2ce07bd8
No related branches found
No related tags found
No related merge requests found
Showing
with 107 additions and 64 deletions
/bin
/target
/testdata/
......@@ -54,6 +54,7 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
......@@ -99,6 +100,7 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
......@@ -146,6 +148,7 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
......@@ -223,6 +226,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
......
......@@ -5,16 +5,18 @@ cleanup.add_missing_deprecated_annotations=true
cleanup.add_missing_methods=false
cleanup.add_missing_nls_tags=false
cleanup.add_missing_override_annotations=true
cleanup.add_missing_override_annotations_interface_methods=false
cleanup.add_missing_override_annotations_interface_methods=true
cleanup.add_serial_version_id=true
cleanup.always_use_blocks=true
cleanup.always_use_parentheses_in_expressions=true
cleanup.always_use_this_for_non_static_field_access=true
cleanup.always_use_this_for_non_static_method_access=true
cleanup.always_use_this_for_non_static_field_access=false
cleanup.always_use_this_for_non_static_method_access=false
cleanup.convert_functional_interfaces=true
cleanup.convert_to_enhanced_for_loop=true
cleanup.correct_indentation=true
cleanup.format_source_code=true
cleanup.format_source_code_changes_only=false
cleanup.insert_inferred_type_arguments=false
cleanup.make_local_variable_final=true
cleanup.make_parameters_final=true
cleanup.make_private_fields_final=true
......@@ -29,6 +31,7 @@ cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=tru
cleanup.qualify_static_member_accesses_with_declaring_class=true
cleanup.qualify_static_method_accesses_with_declaring_class=true
cleanup.remove_private_constructors=true
cleanup.remove_redundant_type_arguments=true
cleanup.remove_trailing_whitespaces=true
cleanup.remove_trailing_whitespaces_all=true
cleanup.remove_trailing_whitespaces_ignore_empty=false
......@@ -42,18 +45,21 @@ cleanup.remove_unused_private_methods=true
cleanup.remove_unused_private_types=true
cleanup.sort_members=false
cleanup.sort_members_all=false
cleanup.use_anonymous_class_creation=false
cleanup.use_blocks=true
cleanup.use_blocks_only_for_return_and_throw=false
cleanup.use_lambda=true
cleanup.use_parentheses_in_expressions=true
cleanup.use_this_for_non_static_field_access=false
cleanup.use_this_for_non_static_field_access_only_if_necessary=false
cleanup.use_this_for_non_static_field_access=true
cleanup.use_this_for_non_static_field_access_only_if_necessary=true
cleanup.use_this_for_non_static_method_access=true
cleanup.use_this_for_non_static_method_access_only_if_necessary=false
cleanup_profile=_TeeTime
cleanup.use_this_for_non_static_method_access_only_if_necessary=true
cleanup.use_type_arguments=false
cleanup_profile=_TeeTime - Clean Up
cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
formatter_profile=_Kieker - Profile
formatter_profile=_TeeTime - Profile
formatter_settings_version=12
org.eclipse.jdt.ui.ignorelowercasenames=true
org.eclipse.jdt.ui.importorder=java;javax;junit;org;com;kieker;kieker.test;
......
eclipse.preferences.version=1
org.moreunit.core.anyLanguage.srcFolderPathTemplate=${srcProject}
org.moreunit.core.anyLanguage.testFileNameTemplate=${srcFile}Test
org.moreunit.core.anyLanguage.testFolderPathTemplate=${srcProject}
eclipse.preferences.version=1
org.moreunit.preferences.version=2
org.moreunit.unitsourcefolder=teetime\:src/main/java\:teetime\:src/test/java\#teetime\:src/main/java\:teetime\:src/performancetest/java
org.moreunit.useprojectsettings=true
[related to tea]
https://www.iconfinder.com/icons/1393/coffee_cup_hot_tea_icon#size=128
https://www.iconfinder.com/icons/264396/cup_drink_mug_tea_icon#size=512
https://www.iconfinder.com/icons/286054/cup_drink_glass_hot_tea_icon#size=512
[related to T]
[related to time]
https://www.iconfinder.com/icons/56268/clock_time_wait_watch_icon#size=256
https://www.iconfinder.com/icons/62306/clock_time_wait_icon#size=126
https://www.iconfinder.com/icons/276150/clock_time_timer_watch_icon#size=512
https://www.iconfinder.com/icons/227850/alarm_clock_time_timer_wait_watch_icon#size=512
https://www.iconfinder.com/icons/298242/alarm_business_clock_deadline_efficiency_estimate_event_fast_finish_fire_hot_hot_time_hours_meeting_deadline_minutes_productivity_quick_schedule_seconds_seo_time_time_management_timer_timing_wait_watch_icon#size=512
https://www.iconfinder.com/icons/257522/alarm_clock_date_efficiency_event_fast_hourglass_loading_marketing_measure_minute_remind_sand_sandwatch_schedule_second_seo_stopwatch_time_timed_timer_wait_waiting_watch_web_working_icon#size=128
https://www.iconfinder.com/icons/334159/alarm_business_clock_deadline_efficiency_estimate_event_fast_finish_fire_hot_hours_management_meeting_minutes_productivity_quick_schedule_seconds_seo_time_timer_timing_wait_watch_icon#size=256
[tea & time]
http://findicons.com/icon/103028/tealife2_icon_24
......@@ -3,8 +3,12 @@ package teetime.framework;
import java.util.LinkedList;
import java.util.List;
import teetime.framework.pipe.PipeFactoryRegistry;
public class AnalysisConfiguration {
protected static final PipeFactoryRegistry PIPE_FACTORY_REGISTRY = PipeFactoryRegistry.INSTANCE;
private final List<HeadStage> consumerStages = new LinkedList<HeadStage>();
private final List<HeadStage> finiteProducerStages = new LinkedList<HeadStage>();
private final List<HeadStage> infiniteProducerStages = new LinkedList<HeadStage>();
......
......@@ -2,8 +2,8 @@ package teetime.framework.pipe;
import teetime.framework.InputPort;
import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public interface IPipeFactory {
......
......@@ -2,8 +2,8 @@ package teetime.framework.pipe;
import teetime.framework.InputPort;
import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class OrderedGrowableArrayPipeFactory implements IPipeFactory {
......
......@@ -8,9 +8,9 @@ import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PipeFactory {
public class PipeFactoryRegistry {
private static final Logger LOGGER = LoggerFactory.getLogger(PipeFactory.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PipeFactoryRegistry.class);
public enum ThreadCommunication {
INTER, INTRA
......@@ -30,9 +30,9 @@ public class PipeFactory {
private final Map<String, IPipeFactory> pipeFactories = new HashMap<String, IPipeFactory>();
public static PipeFactory INSTANCE = new PipeFactory();
public static PipeFactoryRegistry INSTANCE = new PipeFactoryRegistry();
private PipeFactory() {
private PipeFactoryRegistry() {
try {
List<IPipeFactory> pipeFactories = PipeFactoryLoader.loadFromFile("conf/pipe-factories.conf");
for (IPipeFactory pipeFactory : pipeFactories) {
......
......@@ -2,8 +2,8 @@ package teetime.framework.pipe;
import teetime.framework.InputPort;
import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class SingleElementPipeFactory implements IPipeFactory {
......
......@@ -2,8 +2,8 @@ package teetime.framework.pipe;
import teetime.framework.InputPort;
import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class SpScPipeFactory implements IPipeFactory {
......
......@@ -2,8 +2,8 @@ package teetime.framework.pipe;
import teetime.framework.InputPort;
import teetime.framework.OutputPort;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
public class UnorderedGrowablePipeFactory implements IPipeFactory {
......
package teetime.stage.io;
package teetime.stage;
import teetime.framework.ConsumerStage;
import teetime.framework.OutputPort;
......@@ -9,10 +9,10 @@ public class ByteArray2String extends ConsumerStage<byte[]> {
@Override
protected void execute(final byte[] element) {
this.send(outputPort, new String(element));
this.send(this.outputPort, new String(element));
}
public OutputPort<? extends String> getOutputPort() {
return outputPort;
return this.outputPort;
}
}
package teetime.stage.io;
package teetime.stage;
import java.security.spec.KeySpec;
......@@ -15,14 +15,14 @@ public class CipherByteArray extends ConsumerStage<byte[]> {
private final OutputPort<byte[]> outputPort = this.createOutputPort();
private Cipher cipher = null;
private final byte[] salt = { 't', 'e', 's', 't' };
private SecretKeySpec skeyspec = null;
public enum CipherMode {
ENCRYPT, DECRYPT
}
public CipherByteArray(final String password, final CipherMode mode) {
final byte[] salt = { 't', 'e', 's', 't' };
SecretKeySpec skeyspec = null;
KeySpec keySpec = new PBEKeySpec(password.toCharArray(),
salt,
......@@ -40,11 +40,11 @@ public class CipherByteArray extends ConsumerStage<byte[]> {
skeyspec = new SecretKeySpec(secretKey.getEncoded(), "AES");
try {
cipher = Cipher.getInstance(skeyspec.getAlgorithm());
this.cipher = Cipher.getInstance(skeyspec.getAlgorithm());
if (mode == CipherMode.ENCRYPT) {
cipher.init(Cipher.ENCRYPT_MODE, skeyspec);
this.cipher.init(Cipher.ENCRYPT_MODE, skeyspec);
} else {
cipher.init(Cipher.DECRYPT_MODE, skeyspec);
this.cipher.init(Cipher.DECRYPT_MODE, skeyspec);
}
} catch (Exception e) {
e.printStackTrace();
......@@ -57,16 +57,16 @@ public class CipherByteArray extends ConsumerStage<byte[]> {
byte[] output = null;
try {
output = cipher.doFinal(element);
output = this.cipher.doFinal(element);
} catch (Exception e) {
e.printStackTrace();
}
this.send(outputPort, output);
this.send(this.outputPort, output);
}
public OutputPort<? extends byte[]> getOutputPort() {
return outputPort;
return this.outputPort;
}
}
package teetime.stage.io;
package teetime.stage;
import java.util.StringTokenizer;
......@@ -16,14 +16,14 @@ public class Tokenizer extends ConsumerStage<String> {
@Override
protected void execute(final String element) {
StringTokenizer st = new StringTokenizer(element, regex);
StringTokenizer st = new StringTokenizer(element, this.regex);
while (st.hasMoreTokens()) {
this.send(outputPort, st.nextToken());
this.send(this.outputPort, st.nextToken());
}
}
public OutputPort<? extends String> getOutputPort() {
return outputPort;
return this.outputPort;
}
}
package teetime.stage.io;
package teetime.stage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
......@@ -40,10 +40,10 @@ public class ZipByteArray extends ConsumerStage<byte[]> {
} catch (Exception e) {
e.printStackTrace();
}
this.send(outputPort, cache);
this.send(this.outputPort, cache);
}
public static byte[] compress(final byte[] data) throws IOException {
private byte[] compress(final byte[] data) throws IOException {
Deflater deflater = new Deflater();
deflater.setInput(data);
......@@ -63,7 +63,7 @@ public class ZipByteArray extends ConsumerStage<byte[]> {
return output;
}
public static byte[] decompress(final byte[] data) throws IOException, DataFormatException {
private byte[] decompress(final byte[] data) throws IOException, DataFormatException {
Inflater inflater = new Inflater();
inflater.setInput(data);
......@@ -82,7 +82,7 @@ public class ZipByteArray extends ConsumerStage<byte[]> {
}
public OutputPort<? extends byte[]> getOutputPort() {
return outputPort;
return this.outputPort;
}
}
......@@ -2,21 +2,28 @@ package teetime.stage.io;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import teetime.framework.ConsumerStage;
import com.google.common.io.Files;
public class ByteArrayFileWriter extends ConsumerStage<byte[]> {
private final File file;
public ByteArrayFileWriter(final File file) {
this.file = file;
try {
Files.touch(file);
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
protected void execute(final byte[] element) {
FileOutputStream fo;
// TODO check if file exists, otherwise create file
try {
fo = new FileOutputStream(this.file);
fo.write(element);
......
......@@ -17,14 +17,14 @@ public class File2ByteArray extends ConsumerStage<File> implements HeadStage {
protected void execute(final File element) {
try {
byte[] cache = Files.toByteArray(element);
this.send(outputPort, cache);
this.send(this.outputPort, cache);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
public OutputPort<? extends byte[]> getOutputPort() {
return outputPort;
return this.outputPort;
}
@Override
......
......@@ -18,12 +18,12 @@ package teetime.stage.kieker;
import java.io.File;
import teetime.framework.InputPort;
import teetime.framework.OutputPort;
import teetime.framework.OldPipeline;
import teetime.framework.pipe.PipeFactory;
import teetime.framework.pipe.SingleElementPipe;
import teetime.framework.pipe.PipeFactory.PipeOrdering;
import teetime.framework.pipe.PipeFactory.ThreadCommunication;
import teetime.framework.OutputPort;
import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryRegistry;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
import teetime.stage.FileExtensionSwitch;
import teetime.stage.basic.merger.Merger;
import teetime.stage.io.Directory2FilesFilter;
......@@ -44,7 +44,7 @@ import kieker.common.util.filesystem.FSUtil;
*/
public class Dir2RecordsFilter extends OldPipeline<ClassNameRegistryCreationFilter, Merger<IMonitoringRecord>> {
private final PipeFactory pipeFactory = PipeFactory.INSTANCE;
private final PipeFactoryRegistry pipeFactoryRegistry = PipeFactoryRegistry.INSTANCE;
private ClassNameRegistryRepository classNameRegistryRepository;
/**
......@@ -72,19 +72,17 @@ public class Dir2RecordsFilter extends OldPipeline<ClassNameRegistryCreationFilt
final OutputPort<File> zipFileOutputPort = fileExtensionSwitch.addFileExtension(FSUtil.ZIP_FILE_EXTENSION);
// connect ports by pipes
this.pipeFactory.create(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false, 1)
.connectPorts(classNameRegistryCreationFilter.getOutputPort(), directory2FilesFilter.getInputPort());
this.pipeFactory.create(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false, 1)
.connectPorts(directory2FilesFilter.getOutputPort(), fileExtensionSwitch.getInputPort());
IPipeFactory pipeFactory = pipeFactoryRegistry.getPipeFactory(ThreadCommunication.INTRA, PipeOrdering.ARBITRARY, false);
pipeFactory.create(classNameRegistryCreationFilter.getOutputPort(), directory2FilesFilter.getInputPort());
pipeFactory.create(directory2FilesFilter.getOutputPort(), fileExtensionSwitch.getInputPort());
SingleElementPipe.connect(normalFileOutputPort, datFile2RecordFilter.getInputPort());
SingleElementPipe.connect(binFileOutputPort, binaryFile2RecordFilter.getInputPort());
SingleElementPipe.connect(zipFileOutputPort, zipFile2RecordFilter.getInputPort());
pipeFactory.create(normalFileOutputPort, datFile2RecordFilter.getInputPort());
pipeFactory.create(binFileOutputPort, binaryFile2RecordFilter.getInputPort());
pipeFactory.create(zipFileOutputPort, zipFile2RecordFilter.getInputPort());
SingleElementPipe.connect(datFile2RecordFilter.getOutputPort(), recordMerger.getNewInputPort());
SingleElementPipe.connect(binaryFile2RecordFilter.getOutputPort(), recordMerger.getNewInputPort());
SingleElementPipe.connect(zipFile2RecordFilter.getOutputPort(), recordMerger.getNewInputPort());
pipeFactory.create(datFile2RecordFilter.getOutputPort(), recordMerger.getNewInputPort());
pipeFactory.create(binaryFile2RecordFilter.getOutputPort(), recordMerger.getNewInputPort());
pipeFactory.create(zipFile2RecordFilter.getOutputPort(), recordMerger.getNewInputPort());
// prepare pipeline
this.setFirstStage(classNameRegistryCreationFilter);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment