X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2FTestClassNaming.java;h=9d501c16b28af9d917c0a96282a9a651edd7a348;hp=283e0e14e4b76c368efe479afc13bd27de12c836;hb=fad36d463b75c3a9944d875fc627c3533f6da74d;hpb=bb5a3edf299cb943999c72c69dd68fb740c8a506 diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/TestClassNaming.java b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/TestClassNaming.java index 283e0e14e..9d501c16b 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/TestClassNaming.java +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/TestClassNaming.java @@ -1,46 +1,45 @@ -package org.simantics.scl.compiler.tests; - -import org.junit.Test; -import org.simantics.scl.compiler.elaboration.java.Builtins; -import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification; -import org.simantics.scl.compiler.module.ImportDeclaration; -import org.simantics.scl.compiler.module.repository.ModuleRepository; -import org.simantics.scl.compiler.module.repository.UpdateListener; -import org.simantics.scl.compiler.runtime.RuntimeEnvironment; -import org.simantics.scl.compiler.source.PrecompiledModuleSource; -import org.simantics.scl.compiler.source.StringModuleSource; -import org.simantics.scl.compiler.source.repository.MapModuleSourceRepository; -import org.simantics.scl.compiler.source.repository.ModuleSourceRepository; -import org.simantics.scl.compiler.top.ExpressionEvaluator; - -import junit.framework.Assert; - -public class TestClassNaming { - - private static class SimpleModuleSource extends StringModuleSource { - public SimpleModuleSource(String moduleName, String moduleText) { - super(moduleName, moduleText); - } - - @Override - protected ImportDeclaration[] getBuiltinImports(UpdateListener listener) { - return new ImportDeclaration[] {new ImportDeclaration("Builtin", "")}; - } - } - - @Test - public void testClassNaming() throws Exception { - ModuleSourceRepository sourceRepository = new MapModuleSourceRepository( - new PrecompiledModuleSource(Builtins.INSTANCE), - new SimpleModuleSource("http://ProjectGame@A/SCLConstants", - "locale = \"fi-FI\"") - ); - ModuleRepository moduleRepository = new ModuleRepository(sourceRepository); - RuntimeEnvironment runtimeEnvironment = moduleRepository.createRuntimeEnvironment( - EnvironmentSpecification.of( - "http://ProjectGame@A/SCLConstants", ""), - getClass().getClassLoader()); - Assert.assertEquals("fi-FI", new ExpressionEvaluator(runtimeEnvironment, "locale").eval()); - } - -} +package org.simantics.scl.compiler.tests; + +import org.junit.Assert; +import org.junit.Test; +import org.simantics.scl.compiler.elaboration.java.Builtins; +import org.simantics.scl.compiler.environment.specification.EnvironmentSpecification; +import org.simantics.scl.compiler.module.ImportDeclaration; +import org.simantics.scl.compiler.module.repository.ModuleRepository; +import org.simantics.scl.compiler.module.repository.UpdateListener; +import org.simantics.scl.compiler.runtime.RuntimeEnvironment; +import org.simantics.scl.compiler.source.PrecompiledModuleSource; +import org.simantics.scl.compiler.source.StringModuleSource; +import org.simantics.scl.compiler.source.repository.MapModuleSourceRepository; +import org.simantics.scl.compiler.source.repository.ModuleSourceRepository; +import org.simantics.scl.compiler.top.ExpressionEvaluator; + +public class TestClassNaming { + + private static class SimpleModuleSource extends StringModuleSource { + public SimpleModuleSource(String moduleName, String moduleText) { + super(moduleName, moduleText); + } + + @Override + protected ImportDeclaration[] getBuiltinImports(UpdateListener listener) { + return new ImportDeclaration[] {new ImportDeclaration("Builtin", "")}; + } + } + + @Test + public void testClassNaming() throws Exception { + ModuleSourceRepository sourceRepository = new MapModuleSourceRepository( + new PrecompiledModuleSource(Builtins.INSTANCE), + new SimpleModuleSource("http://ProjectGame@A/SCLConstants", + "locale = \"fi-FI\"") + ); + ModuleRepository moduleRepository = new ModuleRepository(sourceRepository); + RuntimeEnvironment runtimeEnvironment = moduleRepository.createRuntimeEnvironment( + EnvironmentSpecification.of( + "http://ProjectGame@A/SCLConstants", ""), + getClass().getClassLoader()); + Assert.assertEquals("fi-FI", new ExpressionEvaluator(runtimeEnvironment, "locale").eval()); + } + +}