mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-26 10:25:32 +02:00
Generics.
This commit is contained in:
parent
2ee14c041c
commit
a19dfee63c
4 changed files with 42 additions and 62 deletions
|
@ -65,19 +65,19 @@ public class TemplateEngineTestsHelper {
|
||||||
|
|
||||||
public static TemplateCore[] getTestTemplates() {
|
public static TemplateCore[] getTestTemplates() {
|
||||||
TemplateCore[] templates = TemplateEngine.getDefault().getTemplates();
|
TemplateCore[] templates = TemplateEngine.getDefault().getTemplates();
|
||||||
List testTemplates = new ArrayList();
|
List<TemplateCore> testTemplates = new ArrayList<TemplateCore>();
|
||||||
for (int i =0; i < templates.length; i++) {
|
for (int i = 0; i < templates.length; i++) {
|
||||||
if (templates[i].getTemplateType().equals("TestTemplate")) {
|
if (templates[i].getTemplateType().equals("TestTemplate")) {
|
||||||
testTemplates.add(templates[i]);
|
testTemplates.add(templates[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (TemplateCore[]) testTemplates.toArray(new TemplateCore[testTemplates.size()]);
|
return testTemplates.toArray(new TemplateCore[testTemplates.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getChildCount(TemplateDescriptor templateDescriptor, String propertyGroupID){
|
public static int getChildCount(TemplateDescriptor templateDescriptor, String propertyGroupID){
|
||||||
List list = templateDescriptor.getPropertyGroupList();
|
List<Element> list = templateDescriptor.getPropertyGroupList();
|
||||||
for (int i = 0, l = list.size(); i < l; i++) {
|
for (int i = 0, l = list.size(); i < l; i++) {
|
||||||
Element element = (Element) list.get(i);
|
Element element = list.get(i);
|
||||||
NamedNodeMap attributes = element.getAttributes();
|
NamedNodeMap attributes = element.getAttributes();
|
||||||
for (int j = 0, l1 = attributes.getLength(); j < l1; j++) {
|
for (int j = 0, l1 = attributes.getLength(); j < l1; j++) {
|
||||||
String value = attributes.item(j).getNodeValue();
|
String value = attributes.item(j).getNodeValue();
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Bala Torati (Symbian) - Initial API and implementation
|
* Bala Torati (Symbian) - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.tests.templateengine;
|
package org.eclipse.cdt.ui.tests.templateengine;
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
|
||||||
public class TestProcesses extends BaseTestCase {
|
public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
private static final String workspaceLocation = ResourcesPlugin.getWorkspace().getRoot().getRawLocation().toOSString();
|
private static final String workspaceLocation = ResourcesPlugin.getWorkspace().getRoot().getRawLocation().toOSString();
|
||||||
private static final String PROJECT_NAME = "TemplateEngineTestsProject"; //$NON-NLS-1$
|
private static final String PROJECT_NAME = "TemplateEngineTestsProject"; //$NON-NLS-1$
|
||||||
private static final String SOURCE_FOLDER = "Source"; //$NON-NLS-1$
|
private static final String SOURCE_FOLDER = "Source"; //$NON-NLS-1$
|
||||||
|
@ -63,7 +62,7 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
public void testAddFile() {
|
public void testAddFile() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AddFile"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AddFile"); //$NON-NLS-1$
|
||||||
Map valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
||||||
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
||||||
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
@ -84,7 +83,7 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
public void testAddFiles() {
|
public void testAddFiles() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AddFiles"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AddFiles"); //$NON-NLS-1$
|
||||||
Map valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
||||||
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
||||||
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
@ -105,7 +104,7 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
public void testAddLink() {
|
public void testAddLink() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AddLink"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AddLink"); //$NON-NLS-1$
|
||||||
Map valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
||||||
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
||||||
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
@ -131,7 +130,7 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
public void testAppend() {
|
public void testAppend() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*Append"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*Append"); //$NON-NLS-1$
|
||||||
Map valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
||||||
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
||||||
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
@ -160,7 +159,7 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
public void testAppendCreate() {
|
public void testAppendCreate() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AppendCreate"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*AppendCreate"); //$NON-NLS-1$
|
||||||
Map valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
||||||
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
||||||
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
@ -184,7 +183,7 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
public void testCopy() {
|
public void testCopy() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*Copy"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*Copy"); //$NON-NLS-1$
|
||||||
Map valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
||||||
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
||||||
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
@ -213,7 +212,7 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
public void testCreateResourceIdentifier() {
|
public void testCreateResourceIdentifier() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*CreateResourceIdentifier"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*CreateResourceIdentifier"); //$NON-NLS-1$
|
||||||
Map valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
||||||
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
||||||
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
@ -237,7 +236,7 @@ public class TestProcesses extends BaseTestCase {
|
||||||
|
|
||||||
public void testCreateSourceFolder() {
|
public void testCreateSourceFolder() {
|
||||||
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*CreateSourceFolder"); //$NON-NLS-1$
|
TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*CreateSourceFolder"); //$NON-NLS-1$
|
||||||
Map valueStore = template.getValueStore();
|
Map<String, String> valueStore = template.getValueStore();
|
||||||
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
valueStore.put("projectName", PROJECT_NAME); //$NON-NLS-1$
|
||||||
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
valueStore.put("projectType", PROJECT_TYPE); //$NON-NLS-1$
|
||||||
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
valueStore.put("location", ""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
|
@ -6,11 +6,10 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Bala Torati (Symbian) - Initial API and implementation
|
* Bala Torati (Symbian) - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.tests.templateengine;
|
package org.eclipse.cdt.ui.tests.templateengine;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -18,7 +17,6 @@ import java.util.Set;
|
||||||
import org.eclipse.cdt.core.templateengine.SharedDefaults;
|
import org.eclipse.cdt.core.templateengine.SharedDefaults;
|
||||||
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes all the test cases of SharedDefaults backend functionality
|
* Executes all the test cases of SharedDefaults backend functionality
|
||||||
*/
|
*/
|
||||||
|
@ -36,7 +34,6 @@ public class TestSharedDefaults extends BaseTestCase {
|
||||||
/*
|
/*
|
||||||
* @see TestCase#tearDown()
|
* @see TestCase#tearDown()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
protected void tearDown(){
|
protected void tearDown(){
|
||||||
sharedDefaults = null;
|
sharedDefaults = null;
|
||||||
}
|
}
|
||||||
|
@ -45,47 +42,39 @@ public class TestSharedDefaults extends BaseTestCase {
|
||||||
* This test checks if data gets added to the back end
|
* This test checks if data gets added to the back end
|
||||||
* New data gets persisted in SharedDefault XML file
|
* New data gets persisted in SharedDefault XML file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public void testAddToBackEndStorage() {
|
public void testAddToBackEndStorage() {
|
||||||
Map actualSharedDefaults=sharedDefaults.getSharedDefaultsMap();
|
Map<String, String> actualSharedDefaults= sharedDefaults.getSharedDefaultsMap();
|
||||||
|
|
||||||
actualSharedDefaults.put("provider.name","eclipse"); //$NON-NLS-1$ //$NON-NLS-2$
|
actualSharedDefaults.put("provider.name","eclipse"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
actualSharedDefaults.put("copyright","Symbian Software Ltd."); //$NON-NLS-1$ //$NON-NLS-2$
|
actualSharedDefaults.put("copyright","Symbian Software Ltd."); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
actualSharedDefaults.put("author","Bala Torati"); //$NON-NLS-1$ //$NON-NLS-2$
|
actualSharedDefaults.put("author","Bala Torati"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
Map expectedSharedDefaults=sharedDefaults.getSharedDefaultsMap();
|
Map<String, String> expectedSharedDefaults= sharedDefaults.getSharedDefaultsMap();
|
||||||
|
|
||||||
assertEquals("Contents are different :", //$NON-NLS-1$
|
assertEquals("Contents are different :", //$NON-NLS-1$
|
||||||
expectedSharedDefaults,
|
expectedSharedDefaults,
|
||||||
actualSharedDefaults);
|
actualSharedDefaults);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This tests the updateToBackEndStorage of SharedDefaults
|
* This tests the updateToBackEndStorage of SharedDefaults
|
||||||
* to verify whether the key-value pair gets updated with new value
|
* to verify whether the key-value pair gets updated with new value
|
||||||
* New data gets persisted in SharedDefault XML file
|
* New data gets persisted in SharedDefault XML file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public void testUpdateToBackEndStorage() {
|
public void testUpdateToBackEndStorage() {
|
||||||
Map actualSharedDefaults = sharedDefaults.getSharedDefaultsMap();
|
Map<String, String> actualSharedDefaults = sharedDefaults.getSharedDefaultsMap();
|
||||||
Set keySet = actualSharedDefaults.keySet();
|
|
||||||
Iterator iterator = keySet.iterator();
|
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
for (Map.Entry<String, String> entry : actualSharedDefaults.entrySet()) {
|
||||||
Object key = iterator.next();
|
String key = entry.getKey();
|
||||||
Object value = actualSharedDefaults.get(key);
|
String value = entry.getValue();
|
||||||
String keyName = (String)key;
|
if (key.equals("org.eclipse.cdt.templateengine.project.HelloWorld.basename")) { //$NON-NLS-1$
|
||||||
String valueName = (String)value;
|
entry.setValue("Astala Vista"); //$NON-NLS-1$
|
||||||
if (keyName.equals("org.eclipse.cdt.templateengine.project.HelloWorld.basename")){ //$NON-NLS-1$
|
sharedDefaults.updateToBackEndStorage("org.eclipse.cdt.templateengine.project.HelloWorld.basename", value); //$NON-NLS-1$
|
||||||
valueName = "Astala Vista"; //$NON-NLS-1$
|
break;
|
||||||
actualSharedDefaults.put(keyName, valueName);
|
|
||||||
sharedDefaults.updateToBackEndStorage("org.eclipse.cdt.templateengine.project.HelloWorld.basename", valueName); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map expectedSharedDefaults=sharedDefaults.getSharedDefaultsMap();
|
Map<String, String> expectedSharedDefaults=sharedDefaults.getSharedDefaultsMap();
|
||||||
|
|
||||||
assertEquals("Contents are different :", //$NON-NLS-1$
|
assertEquals("Contents are different :", //$NON-NLS-1$
|
||||||
expectedSharedDefaults,
|
expectedSharedDefaults,
|
||||||
|
@ -96,25 +85,23 @@ public class TestSharedDefaults extends BaseTestCase {
|
||||||
* This tests the deleteBackEndStorage of SharedDefaults
|
* This tests the deleteBackEndStorage of SharedDefaults
|
||||||
* to verify whether the key-value pair gets deleted at the backend
|
* to verify whether the key-value pair gets deleted at the backend
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public void testDeleteBackEndStorage() {
|
public void testDeleteBackEndStorage() {
|
||||||
Map actualSharedDefaults=sharedDefaults.getSharedDefaultsMap();
|
Map<String, String> actualSharedDefaults= sharedDefaults.getSharedDefaultsMap();
|
||||||
Set keySet = actualSharedDefaults.keySet();
|
Set<String> keySet = actualSharedDefaults.keySet();
|
||||||
Iterator iterator = keySet.iterator();
|
Iterator<String> iterator = keySet.iterator();
|
||||||
String keyName = null;
|
String keyName = null;
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
|
String key = iterator.next();
|
||||||
Object key = iterator.next();
|
keyName = key;
|
||||||
keyName = (String)key;
|
|
||||||
if (keyName.equals("org.eclipse.cdt.templateengine.project.HelloWorld.basename")) { //$NON-NLS-1$
|
if (keyName.equals("org.eclipse.cdt.templateengine.project.HelloWorld.basename")) { //$NON-NLS-1$
|
||||||
actualSharedDefaults.remove(keyName);
|
actualSharedDefaults.remove(keyName);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sharedDefaults.deleteBackEndStorage(new String[]{keyName});
|
sharedDefaults.deleteBackEndStorage(new String[] { keyName });
|
||||||
Map expectedSharedDefaults=sharedDefaults.getSharedDefaultsMap();
|
Map<String, String> expectedSharedDefaults= sharedDefaults.getSharedDefaultsMap();
|
||||||
|
|
||||||
assertEquals("Contents are different :", //$NON-NLS-1$
|
assertEquals("Contents are different :", //$NON-NLS-1$
|
||||||
expectedSharedDefaults,
|
expectedSharedDefaults,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Bala Torati (Symbian) - Initial API and implementation
|
* Bala Torati (Symbian) - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.ui.tests.templateengine;
|
package org.eclipse.cdt.ui.tests.templateengine;
|
||||||
|
|
||||||
|
@ -17,13 +17,10 @@ import org.eclipse.cdt.core.templateengine.TemplateCore;
|
||||||
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
|
import org.eclipse.cdt.core.templateengine.TemplateDescriptor;
|
||||||
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test the functionality of the ValueStore class.
|
* Test the functionality of the ValueStore class.
|
||||||
*/
|
*/
|
||||||
public class TestValueStore extends BaseTestCase {
|
public class TestValueStore extends BaseTestCase {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setUp is called before execution of test method.
|
* setUp is called before execution of test method.
|
||||||
*/
|
*/
|
||||||
|
@ -44,12 +41,11 @@ public class TestValueStore extends BaseTestCase {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test ValueStore for Not Null condition.
|
* Test ValueStore for Not Null condition.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public void testValueStoreNotNull(){
|
public void testValueStoreNotNull(){
|
||||||
TemplateCore[] templates = TemplateEngineTestsHelper.getTestTemplates();
|
TemplateCore[] templates = TemplateEngineTestsHelper.getTestTemplates();
|
||||||
for (int i=0; i <templates.length; i++) {
|
for (int i = 0; i < templates.length; i++) {
|
||||||
Map valueStore = templates[i].getValueStore();
|
Map<String, String> valueStore = templates[i].getValueStore();
|
||||||
assertNotNull(valueStore);
|
assertNotNull(valueStore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,18 +56,16 @@ public class TestValueStore extends BaseTestCase {
|
||||||
*/
|
*/
|
||||||
public void testCompareValueStoreWithTemplateDefaluts(){
|
public void testCompareValueStoreWithTemplateDefaluts(){
|
||||||
TemplateCore[] templates = TemplateEngineTestsHelper.getTestTemplates();
|
TemplateCore[] templates = TemplateEngineTestsHelper.getTestTemplates();
|
||||||
for (int i=0; i <templates.length; i++) {
|
for (int i = 0; i < templates.length; i++) {
|
||||||
Map valueStore = templates[i].getValueStore();
|
Map<String, String> valueStore = templates[i].getValueStore();
|
||||||
TemplateDescriptor templateDescriptor = templates[i].getTemplateDescriptor();
|
TemplateDescriptor templateDescriptor = templates[i].getTemplateDescriptor();
|
||||||
Map templateDefaults = templateDescriptor.getTemplateDefaults(templateDescriptor.getRootElement());
|
Map<String, String> templateDefaults = templateDescriptor.getTemplateDefaults(templateDescriptor.getRootElement());
|
||||||
|
|
||||||
Iterator defaultsIterator = templateDefaults.keySet().iterator();
|
Iterator<String> defaultsIterator = templateDefaults.keySet().iterator();
|
||||||
while(defaultsIterator.hasNext()){
|
while (defaultsIterator.hasNext()){
|
||||||
String key = (String)defaultsIterator.next();
|
String key = defaultsIterator.next();
|
||||||
assertNotNull(valueStore.get(key));
|
assertNotNull(valueStore.get(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue