forked from finos/rune-dsl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
caea5e2
commit 842f63f
Showing
2 changed files
with
53 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
rosetta-testing/src/test/java/com/regnosys/rosetta/issues/Issue844.xtend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.regnosys.rosetta.issues | ||
|
||
import com.regnosys.rosetta.tests.RosettaInjectorProvider | ||
import com.regnosys.rosetta.tests.util.CodeGeneratorTestHelper | ||
import org.eclipse.xtext.testing.InjectWith | ||
import org.eclipse.xtext.testing.extensions.InjectionExtension | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.^extension.ExtendWith | ||
|
||
import javax.inject.Inject | ||
|
||
import static org.junit.jupiter.api.Assertions.* | ||
import org.junit.jupiter.api.BeforeAll | ||
import java.util.Map | ||
import org.junit.jupiter.api.TestInstance | ||
import org.junit.jupiter.api.TestInstance.Lifecycle | ||
|
||
// Regression test for https://github.com/finos/rune-dsl/issues/844 | ||
@ExtendWith(InjectionExtension) | ||
@InjectWith(RosettaInjectorProvider) | ||
@TestInstance(Lifecycle.PER_CLASS) | ||
class Issue844 { | ||
|
||
@Inject extension CodeGeneratorTestHelper | ||
|
||
Map<String, String> code | ||
|
||
@BeforeAll | ||
def void setup() { | ||
code = ''' | ||
type Foo: | ||
foo Foo (0..1) | ||
'''.generateCode | ||
} | ||
|
||
@Test | ||
def void shouldNotGenerateFieldWithMeta() { | ||
assertFalse(code.containsKey("com.rosetta.test.model.metafields.FieldWithMetaFoo")) | ||
} | ||
|
||
@Test | ||
def void shouldNotGenerateReferenceWithMeta() { | ||
assertFalse(code.containsKey("com.rosetta.test.model.metafields.ReferenceWithMetaFoo")) | ||
} | ||
} |