Skip to content

Commit

Permalink
add java keyword test
Browse files Browse the repository at this point in the history
  • Loading branch information
MauricioUyaguari committed Sep 5, 2024
1 parent 25f5c5a commit f1bc6b9
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ public void testSourceToTargetM2M()
testCompilation("model.mapping.TestSourceToTargetM2M", "model::mapping::SourceToTargetM2M");
}

@Test
public void testJavaKeyWordCompilation()
{
testCompilation("model.mapping.Test_public", "model::mapping::public");
testCompilation("model.mapping.Test__", "model::mapping::_");
}

@Test
public void testTestService()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ public void testWriteTestClassesWithoutRootPackage() throws IOException
"generated/java/testTestSuites/TestTestService2.java", "generated/java/testTestSuites/TestServiceStoreMapping.java",
"generated/java/testTestSuites/TestMyServiceIsVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVery_38d23576.java",
"generated/java/testTestSuites/TestMyServiceIsââVeryââVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryââââVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryV_a0bb3f4b.java",
"generated/java/model/domain/TestFunctionTest__String_0_1_.java");
"generated/java/model/domain/TestFunctionTest__String_0_1_.java",
"generated/java/model/mapping/Test__.java",
"generated/java/model/mapping/Test_public.java"
);
}

@Test
Expand All @@ -82,7 +85,10 @@ public void testWriteTestClasses() throws IOException
"generated/java/org/finos/legend/sdlc/test/junit/junit4/testTestSuites/TestServiceStoreMapping.java",
"generated/java/org/finos/legend/sdlc/test/junit/junit4/testTestSuites/TestMyServiceIsVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVery_38d23576.java",
"generated/java/org/finos/legend/sdlc/test/junit/junit4/testTestSuites/TestMyServiceIsââVeryââVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryââââVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryV_a0bb3f4b.java",
"generated/java/org/finos/legend/sdlc/test/junit/junit4/model/domain/TestFunctionTest__String_0_1_.java");
"generated/java/org/finos/legend/sdlc/test/junit/junit4/model/domain/TestFunctionTest__String_0_1_.java",
"generated/java/org/finos/legend/sdlc/test/junit/junit4/model/mapping/Test__.java",
"generated/java/org/finos/legend/sdlc/test/junit/junit4/model/mapping/Test_public.java"
);
}

@Test
Expand All @@ -97,7 +103,10 @@ public void testWriteTestClassesOtherPackage() throws IOException
"generated/java/other/test/pkg/testTestSuites/TestServiceStoreMapping.java",
"generated/java/other/test/pkg/testTestSuites/TestMyServiceIsVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVery_38d23576.java",
"generated/java/other/test/pkg/testTestSuites/TestMyServiceIsââVeryââVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryââââVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryV_a0bb3f4b.java",
"generated/java/other/test/pkg/model/domain/TestFunctionTest__String_0_1_.java");
"generated/java/other/test/pkg/model/domain/TestFunctionTest__String_0_1_.java",
"generated/java/other/test/pkg/model/mapping/Test__.java",
"generated/java/other/test/pkg/model/mapping/Test_public.java"
);
}

private void testWriteTestClasses(String rootPackage, String... expectedResources) throws IOException
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"classifierPath": "meta::pure::mapping::Mapping",
"content": {
"package": "model::mapping",
"_type": "mapping",
"name": "_",
"classMappings": [],
"tests": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"classifierPath": "meta::pure::mapping::Mapping",
"content": {
"package": "model::mapping",
"_type": "mapping",
"name": "public",
"classMappings": [],
"tests": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
amend package model.mapping;

import org.finos.legend.sdlc.test.junit.pure.v1.AbstractMappingTest;

public class Test__ extends AbstractMappingTest
{
@Override
protected String getEntityPath()
{
return "model::mapping::_";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package model.mapping;

import org.finos.legend.sdlc.test.junit.pure.v1.AbstractMappingTest;

public class Test_public extends AbstractMappingTest
{
@Override
protected String getEntityPath()
{
return "model::mapping::public";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.finos.legend.sdlc.test.junit.junit4.model.mapping;

import org.finos.legend.sdlc.test.junit.pure.v1.AbstractMappingTest;

public class Test__ extends AbstractMappingTest
{
@Override
protected String getEntityPath()
{
return "model::mapping::_";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.finos.legend.sdlc.test.junit.junit4.model.mapping;

import org.finos.legend.sdlc.test.junit.pure.v1.AbstractMappingTest;

public class Test_public extends AbstractMappingTest
{
@Override
protected String getEntityPath()
{
return "model::mapping::public";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package other.test.pkg.model.mapping;

import org.finos.legend.sdlc.test.junit.pure.v1.AbstractMappingTest;

public class Test__ extends AbstractMappingTest
{
@Override
protected String getEntityPath()
{
return "model::mapping::_";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package other.test.pkg.model.mapping;

import org.finos.legend.sdlc.test.junit.pure.v1.AbstractMappingTest;

public class Test_public extends AbstractMappingTest
{
@Override
protected String getEntityPath()
{
return "model::mapping::public";
}
}

0 comments on commit f1bc6b9

Please sign in to comment.