| /** |
| * Copyright (c) 2017 CEA. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * CEA - initial API and implementation and/or initial documentation |
| */ |
| package org.eclipse.sensinact.studio.language.tests; |
| |
| import com.google.inject.Inject; |
| import org.eclipse.sensinact.studio.language.sensinact.Sensinact; |
| import org.eclipse.sensinact.studio.language.tests.SensinactInjectorProvider; |
| import org.eclipse.xtend2.lib.StringConcatenation; |
| import org.eclipse.xtext.junit4.InjectWith; |
| import org.eclipse.xtext.junit4.XtextRunner; |
| import org.eclipse.xtext.junit4.util.ParseHelper; |
| import org.eclipse.xtext.xbase.lib.Exceptions; |
| import org.junit.Assert; |
| import org.junit.Test; |
| import org.junit.runner.RunWith; |
| |
| @RunWith(XtextRunner.class) |
| @InjectWith(SensinactInjectorProvider.class) |
| @SuppressWarnings("all") |
| public class SensinactParsingTest { |
| @Inject |
| private ParseHelper<Sensinact> parseHelper; |
| |
| @Test |
| public void loadModel() { |
| try { |
| StringConcatenation _builder = new StringConcatenation(); |
| _builder.append("Hello Xtext!"); |
| _builder.newLine(); |
| final Sensinact result = this.parseHelper.parse(_builder); |
| Assert.assertNotNull(result); |
| } catch (Throwable _e) { |
| throw Exceptions.sneakyThrow(_e); |
| } |
| } |
| } |