Commit 7bc0e1f5 authored by stancakapost's avatar stancakapost
Browse files

fixed verdict and template value set to omit

parent 8fb2544a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-ManifestVersion: 2
Bundle-Name: New Test Case
Bundle-Name: New Test Case
Bundle-SymbolicName: org.etsi.mts.ttcn3.part9.newTestCase;singleton:=true
Bundle-SymbolicName: org.etsi.mts.ttcn3.part9.newTestCase;singleton:=true
Bundle-Version: 0.0.4.jdk6
Bundle-Version: 0.0.5.qualifier
Bundle-Activator: org.etsi.mts.ttcn3.part9.popup.actions.Activator
Bundle-Activator: org.etsi.mts.ttcn3.part9.popup.actions.Activator
Require-Bundle: org.eclipse.ui,
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime,
 org.eclipse.core.runtime,
+1 −1
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@ package org.etsi.mts.ttcn3.part9.popup.actions;
public class NewNegativeTestCase extends NewTestCase {
public class NewNegativeTestCase extends NewTestCase {


	public NewNegativeTestCase() {
	public NewNegativeTestCase() {
		super("Neg");
		super(TCKind.Neg);
	}
	}


}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -3,6 +3,6 @@ package org.etsi.mts.ttcn3.part9.popup.actions;
public class NewPositiveTestCase extends NewTestCase {
public class NewPositiveTestCase extends NewTestCase {


	public NewPositiveTestCase() {
	public NewPositiveTestCase() {
		super("Pos");
		super(TCKind.Pos);
	}
	}
}
}
+9 −7
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ public class NewTestCase implements IObjectActionDelegate {


	private Shell shell;
	private Shell shell;


	protected String tckind = "Pos";
	protected TCKind tckind = TCKind.Pos;


	protected ISelection selection;
	protected ISelection selection;
	
	
@@ -32,13 +32,13 @@ public class NewTestCase implements IObjectActionDelegate {
			+ " ** @author   STF 475\n"
			+ " ** @author   STF 475\n"
			+ " ** @version  0.0.1\n"
			+ " ** @version  0.0.1\n"
			+ " ** @purpose  9:%1$s, TODO write purpose\n"
			+ " ** @purpose  9:%1$s, TODO write purpose\n"
			+ " ** @verdict  pass accept, ttcn3verdict:pass\n"
			+ " ** @verdict  pass %4$s\n"
			+ " ***************************************************/\n"
			+ " ***************************************************/\n"
			+ "module %2$s {\n"
			+ "module %2$s {\n"
			+ "\n"
			+ "\n"
			+ "    import from schema_%2$s language \"XSD\" all;\n"
			+ "    import from schema_%2$s language \"XSD\" all;\n"
			+ "    // TODO specify type for the template\n"
			+ "    // TODO specify type for the template\n"
			+ "    template __type__ m_msg := { };\n"
			+ "    template __type__ m_msg := omit;\n"
			+ "\n"
			+ "\n"
			+ "//#TC%3$s\n" 
			+ "//#TC%3$s\n" 
			+"}\n";
			+"}\n";
@@ -59,7 +59,7 @@ public class NewTestCase implements IObjectActionDelegate {
	/**
	/**
	 * Constructor for generic action.
	 * Constructor for generic action.
	 */
	 */
	public NewTestCase(String kind) {
	public NewTestCase(TCKind kind) {
		super();
		super();
		this.tckind = kind;
		this.tckind = kind;
	}
	}
@@ -119,9 +119,11 @@ public class NewTestCase implements IObjectActionDelegate {
			pm.beginTask("New test case", 4);
			pm.beginTask("New test case", 4);
			tcfolder.create(true, true, new NullProgressMonitor());
			tcfolder.create(true, true, new NullProgressMonitor());
			pm.worked(1);
			pm.worked(1);
			String tcMacroSuffix = "Neg".equals(tckind) ? "_Neg" : "";
			String tcMacroSuffix = TCKind.Neg.equals(tckind) ? "_Neg" : "";
			String tcVerdict = TCKind.Neg.equals(tckind) ? "reject" : "accept, ttcn3verdict:pass";

			// TODO get section number
			// TODO get section number
			String ttcn_content = String.format(TTCN_TEMPLATE, section, name, tcMacroSuffix);
			String ttcn_content = String.format(TTCN_TEMPLATE, section, name, tcMacroSuffix, tcVerdict);
			String xsd_content = String.format(XSD_TEMPLATE, name);
			String xsd_content = String.format(XSD_TEMPLATE, name);
			String xml_content = String.format(XML_TEMPLATE, name);
			String xml_content = String.format(XML_TEMPLATE, name);
			
			
@@ -171,7 +173,7 @@ public class NewTestCase implements IObjectActionDelegate {
        String name = null;
        String name = null;
        
        
        for (int i = 1; i < 999; i++) {
        for (int i = 1; i < 999; i++) {
        	name = String.format("%s_%s_%03d", this.tckind, nameBase, i);
        	name = String.format("%s_%s_%03d", this.tckind.name(), nameBase, i);
        	if (null == folder.findMember(name)) return name;
        	if (null == folder.findMember(name)) return name;
        }
        }
        return null;
        return null;