| /** Copyright (C) Conformiq Software Ltd. |
| * All rights reserved. |
| * |
| * Created Wed Aug 27 16:49:21 2008. |
| * |
| * @file Configuration.java |
| * |
| * @author Conformiq Software Ltd. |
| * |
| * |
| */ |
| |
| package com.conformiq.adaptation.ttcn; |
| |
| import java.io.File; |
| |
| public class Configuration |
| { |
| public boolean setConfigurationOption(String property, String value) |
| { |
| if (property.equals("Main.Test suite file")) |
| { |
| mSuiteFile = new File(value); |
| mSuiteModuleName = Utils.buildModuleNameFromFileName(mSuiteFile); |
| } |
| if (property.equals("Project")) |
| { |
| this.mProjectName = value; |
| } |
| else if (property.equals("Main.Import from or generate to data types " |
| + "file")) |
| { |
| mDataTypesFile = new File(value); |
| mDataTypesModuleName = |
| Utils.buildModuleNameFromFileName(mDataTypesFile); |
| } |
| else if (property.equals("Main.Import from or generate to test system " + |
| "file")) |
| { |
| mTestSystemFile = new File(value); |
| mTestSystemModuleName = |
| Utils.buildModuleNameFromFileName(mTestSystemFile); |
| } |
| else if (property.equals("Main.Generate test system information " |
| + "(component and port types)")) |
| { |
| mGenerateTestSystemFile = value.equals("true"); |
| } |
| else if (property.equals("Main.Import from or generate to harness " + |
| "template file")) |
| { |
| mTestHarnessFile = new File(value); |
| mTestHarnessModuleName = |
| Utils.buildModuleNameFromFileName(mTestHarnessFile); |
| } |
| else if (property.equals("Main.Generate protocol data types")) |
| { |
| mGenerateDataTypes = value.equals("true"); |
| } |
| else if (property.equals("Main.Generate test harness function stubs")) |
| { |
| mGenerateTestHarness = value.equals("true"); |
| } |
| else if (property.equals("Logging.Log function name")) |
| { |
| mLogCommand = value; |
| } |
| else if (property.equals("Customization.Component timer name")) |
| { |
| mTimerName = value; |
| } |
| else if (property.equals("Customization.Generated functions prefix")) |
| { |
| mFunctionsPrefix = value; |
| } |
| else if (property.equals("Customization.Default altstep name")) |
| { |
| mDefaultName = value; |
| } |
| else if (property.equals("Customization.Default variable name")) |
| { |
| mDefaultRefName = value; |
| } |
| else if (property.equals("Customization.Start test case hook function " |
| + "name")) |
| { |
| mStartHook = value; |
| } |
| else if (property.equals("Timing.Maximum SUT response time")) |
| { |
| mCommSlack = value; |
| } |
| else if (property.equals("Customization.Extra import statements")) |
| { |
| mExtraImports = value; |
| } |
| else if (property.equals("Customization.MTC type name")) |
| { |
| mRunsOnName = value; |
| } |
| else if (property.equals("Customization.System component type name")) |
| { |
| mSystemTypeName = value; |
| } |
| else if (property.equals("Customization.End test case hook function " |
| + "name")) |
| { |
| mEndHook = value; |
| } |
| else if (property.equals("Extensions.Use port type extension")) |
| { |
| mPortExtensions = value; |
| } |
| else if (property.equals("Logging.Log CQ debug messages")) |
| { |
| mDoLogCQDEbugMessages = value.equals("true"); |
| } |
| else if (property.equals("Logging.Log CQ info messages")) |
| { |
| mDoLogCQInfoMessages = value.equals("true"); |
| } |
| else if (property.equals("Customization.Generate fractions for float " |
| + "numbers")) |
| { |
| mUseFractions = value.equals("true"); |
| } |
| else if (property.equals("EPTF_MBT_Applib.Enable")) |
| { |
| setEptfEnable(value.equals("true")); |
| } |
| else if (property.equals("EPTF_MBT_Applib.Test component extension")) |
| { |
| setExtendsComponent(value); |
| } |
| else if (property.equals("EPTF_MBT_Applib.Inbound Port")) |
| { |
| setEptfInboundPort(value); |
| } |
| else if (property.equals("EPTF_MBT_Applib.Outbound Port")) |
| { |
| setEptfOutboundPort(value); |
| } |
| else if (property.equals("EPTF_MBT_Applib.Bidirectional Ports")) |
| { |
| setEptfBidirectionalPort(value.equals("true")); |
| } |
| else |
| { |
| for (DebugMessageType t : DebugMessageType.values()) |
| { |
| if (property.equals(t.XMLPropertyName)) |
| { |
| t.enabled = value.equals("true"); |
| return true; |
| } |
| |
| } |
| } |
| return true; |
| } |
| |
| public File getSuiteFile() |
| { |
| return mSuiteFile; |
| } |
| |
| public String getSuiteModuleName() |
| { |
| return mSuiteModuleName; |
| } |
| |
| public File getDataTypesFile() |
| { |
| return mDataTypesFile; |
| } |
| |
| public String getDataTypesModuleName() |
| { |
| return mDataTypesModuleName; |
| } |
| |
| public File getTestHarnessFile() |
| { |
| return mTestHarnessFile; |
| } |
| |
| public String getTestHarnessModuleName() |
| { |
| return mTestHarnessModuleName; |
| } |
| |
| public File getTestSystemFile() |
| { |
| return mTestSystemFile; |
| } |
| |
| public String getTestSystemModuleName() |
| { |
| return mTestSystemModuleName; |
| } |
| |
| public String getProjectName() |
| { |
| return mProjectName; |
| } |
| |
| public boolean isGenerateDataTypes() |
| { |
| return mGenerateDataTypes; |
| } |
| |
| public boolean isGenerateTestHarness() |
| { |
| return mGenerateTestHarness; |
| } |
| |
| public String getLogCommand() |
| { |
| return mLogCommand; |
| } |
| |
| public String getTimerName() |
| { |
| return mTimerName; |
| } |
| |
| public String getFunctionsPrefix() |
| { |
| return mFunctionsPrefix; |
| } |
| |
| public String getDefaultName() |
| { |
| return mDefaultName; |
| } |
| |
| public String getDefaultRefName() |
| { |
| return mDefaultRefName; |
| } |
| |
| public String getStartHook() |
| { |
| return mStartHook; |
| } |
| |
| public String getCommSlack() |
| { |
| return mCommSlack; |
| } |
| |
| public String getExtraImports() |
| { |
| return mExtraImports; |
| } |
| |
| public String getRunsOnName() |
| { |
| return mRunsOnName; |
| } |
| |
| public String getSystemTypeName() |
| { |
| return mSystemTypeName; |
| } |
| |
| public String getEndHook() |
| { |
| return mEndHook; |
| } |
| |
| public String getPortExtensions() |
| { |
| return mPortExtensions; |
| } |
| |
| public boolean isDoLogCQDEbugMessages() |
| { |
| return mDoLogCQDEbugMessages; |
| } |
| |
| public boolean isUseFractions() |
| { |
| return mUseFractions; |
| } |
| |
| public boolean isDoLogCQInfoMessages() |
| { |
| return mDoLogCQInfoMessages; |
| } |
| |
| public boolean isGenerateTestSystemFile() |
| { |
| return mGenerateTestSystemFile; |
| } |
| |
| public void setExtendsComponent(String extendsComponent) |
| { |
| this.extendsComponent = extendsComponent; |
| } |
| |
| public String getExtendsComponent() |
| { |
| return extendsComponent; |
| } |
| |
| public void setEptfEnable(boolean eptfEnable) |
| { |
| this.eptfEnable = eptfEnable; |
| } |
| |
| public boolean isEptfEnable() |
| { |
| return eptfEnable; |
| } |
| |
| public void setEptfInboundPort(String eptfInboundPort) |
| { |
| this.eptfInboundPort = eptfInboundPort; |
| } |
| |
| public String getEptfInboundPort() |
| { |
| return eptfInboundPort; |
| } |
| |
| public void setEptfOutboundPort(String eptfOutboundPort) |
| { |
| this.eptfOutboundPort = eptfOutboundPort; |
| } |
| |
| public String getEptfOutboundPort() |
| { |
| return eptfOutboundPort; |
| } |
| |
| public void setEptfBidirectionalPort(boolean eptfBidirectionalPort) |
| { |
| this.eptfBidirectionalPort = eptfBidirectionalPort; |
| } |
| |
| public boolean isEptfBidirectionalPort() |
| { |
| return eptfBidirectionalPort; |
| } |
| |
| private File mSuiteFile; |
| private String mSuiteModuleName; |
| private File mDataTypesFile; |
| private String mDataTypesModuleName; |
| private File mTestHarnessFile; |
| private String mTestHarnessModuleName; |
| private File mTestSystemFile; |
| private String mTestSystemModuleName; |
| private String mProjectName; |
| private boolean mGenerateDataTypes; |
| private boolean mGenerateTestSystemFile; |
| private boolean mGenerateTestHarness; |
| private String mLogCommand; |
| private String mTimerName; |
| private String mFunctionsPrefix; |
| private String mDefaultName; |
| private String mDefaultRefName; |
| private String mStartHook; |
| private String mCommSlack; |
| private String mExtraImports; |
| private String mRunsOnName; |
| private String mSystemTypeName; |
| private String mEndHook; |
| private String mPortExtensions; |
| private boolean mDoLogCQDEbugMessages; |
| private boolean mDoLogCQInfoMessages; |
| private boolean mUseFractions; |
| private String extendsComponent = ""; |
| private boolean eptfEnable = false; |
| private String eptfInboundPort = ""; |
| private String eptfOutboundPort = ""; |
| private boolean eptfBidirectionalPort = false; |
| } |