Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package jadex.tools.testcenter;
 
Helper class to identify test cases.
public class STestCenter
{
Check if a component model can be started as test case.
	public static IFuture	isTestcase(final String modelIExternalAccess access)
	{
		return access.scheduleImmediate(new IComponentStep()
		{
			@XMLClassname("isTestcase")
			{
				final Future	retnew Future();
				final IExternalAccess accessia.getExternalAccess();
				SComponentFactory.isLoadable(accessmodel).addResultListener(new DelegationResultListener(ret)
				{
					public void customResultAvailable(Object result)
					{
						if(((Boolean)result).booleanValue())
						{
							SComponentFactory.loadModel(accessmodel).addResultListener(new DelegationResultListener(ret)
							{
								public void customResultAvailable(Object result)
								{
									boolean	istestfalse;
									IModelInfo model = (IModelInfo)result;
									if(model!=null && model.getReport()==null)
									{
										IArgument[]	resultsmodel.getResults();
										for(int i=0; !istest && i<results.lengthi++)
										{
											if(results[i].getName().equals("testresults") && Testcase.class.equals(results[i].getClazz(model.getClassLoader(), model.getAllImports())))
												istesttrue;
										}
									}
									ret.setResult(Boolean.valueOf(istest));
								}
							});
						}
						else
						{
						}
					}
				});
				return ret;
			}
		});
	}
New to GrepCode? Check out our FAQ X