Author: chatellier Date: 2009-02-10 08:36:15 +0000 (Tue, 10 Feb 2009) New Revision: 1348 Added: topia/trunk/topia-soa/src/test/xmi/ topia/trunk/topia-soa/src/test/xmi/soaTest.properties topia/trunk/topia-soa/src/test/xmi/soaTest.zargo Modified: topia/trunk/topia-soa/pom.xml topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceAbstractGenerator.java topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceInterfaceGenerator.java topia/trunk/topia-ui/pom.xml Log: Ajout d'un d?\195?\169but de test dans topia-soa. Generation de service simple et service li?\195?\169 avec des DAO. Modified: topia/trunk/topia-soa/pom.xml =================================================================== --- topia/trunk/topia-soa/pom.xml 2009-02-09 19:41:35 UTC (rev 1347) +++ topia/trunk/topia-soa/pom.xml 2009-02-10 08:36:15 UTC (rev 1348) @@ -112,6 +112,54 @@ <artifactId>maven-processor-plugin</artifactId> </plugin> + <!-- Add du répertoire de compilation des tests --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.2</version> + <executions> + <execution> + <id>add-test-source</id> + <phase>process-test-sources</phase> + <goals> + <goal>add-test-source</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.codelutin</groupId> + <artifactId>maven-generator-plugin</artifactId> + <version>${generator.version}</version> + <executions> + <execution> + <id>generate-objectmodel</id> + <phase>generate-test-sources</phase> + <configuration> + <fullPackagePath>org.codelutin.soatest</fullPackagePath> + <extractedPackages>org.codelutin.soatest</extractedPackages> + <defaultPackage>org.codelutin.soatest</defaultPackage> + <includes>**/*.objectmodel</includes> + <templates>org.codelutin.topia.generator.TopiaApplicationServiceMetaGenerator</templates> + <extraClassPathDirectory>target/classes</extraClassPathDirectory> + </configuration> + <goals> + <goal>zargo2xmi</goal> + <goal>xmi2objectmodel</goal> + <goal>generate</goal> + </goals> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.codelutin.topia</groupId> + <artifactId>topia-persistence</artifactId> + <version>${project.version}</version> + <scope>compile</scope> + </dependency> + </dependencies> + </plugin> </plugins> </build> Modified: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceAbstractGenerator.java =================================================================== --- topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceAbstractGenerator.java 2009-02-09 19:41:35 UTC (rev 1347) +++ topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceAbstractGenerator.java 2009-02-10 08:36:15 UTC (rev 1348) @@ -99,7 +99,8 @@ // generer les signatures des methodes des entites (getter/setter) generateMethodsGetter(output, interfacez); -/*{} //<%=interfacez.getName()%> +/*{ +} //<%=interfacez.getName()%> }*/ } @@ -141,11 +142,13 @@ } /*{ -public abstract class <%=classifierName%>Abstract extends TopiaApplicationServiceAbstract implements <%=classifierName%>{ }*/ +public abstract class <%=classifierName%>Abstract extends TopiaApplicationServiceAbstract implements <%=classifierName%> { +}*/ } private void generateMethodsGetter(Writer output, ObjectModelClassifier classifier) throws IOException { -/*{ public String[] getMethods(){ +/*{ + public String[] getMethods(){ return methods; } }*/ @@ -157,7 +160,6 @@ String opVisibility = op.getVisibility(); String opType = op.getReturnType(); /*{ - /** * Implementation a la charge du developpeur }*/ @@ -190,7 +192,6 @@ comma = ", "; } /*{; - }*/ } } Modified: topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceInterfaceGenerator.java =================================================================== --- topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceInterfaceGenerator.java 2009-02-09 19:41:35 UTC (rev 1347) +++ topia/trunk/topia-soa/src/main/java/org/codelutin/topia/generator/ServiceInterfaceGenerator.java 2009-02-10 08:36:15 UTC (rev 1348) @@ -79,7 +79,7 @@ private static final String DAO = "dao"; // methodes du service <signature methode> - private List<String> methods = new ArrayList<String>(); + private List<String> methods = null; public ServiceInterfaceGenerator() { super(); @@ -97,6 +97,9 @@ @Override public void generateFromInterface(Writer output, ObjectModelInterface interfacez) throws IOException { + // reset la liste a chaque interface traitée + methods = new ArrayList<String>(); + if (!interfacez.hasStereotype(TopiaGeneratorUtil.STEREOTYPE_SERVICE)) { return; } @@ -176,12 +179,12 @@ } /*{<%=extendClass%>TopiaApplicationService { - }*/ } private void generateMethodsGetter(Writer output, ObjectModelClassifier classifier) throws IOException { -/*{ public abstract String[] getMethods(); +/*{ + public abstract String[] getMethods(); // methodes utilisant celles des entites }*/ @@ -230,7 +233,6 @@ comma = ", "; } /*{; - }*/ // ajout des methodes methods.add(method + ")"); Added: topia/trunk/topia-soa/src/test/xmi/soaTest.properties =================================================================== --- topia/trunk/topia-soa/src/test/xmi/soaTest.properties (rev 0) +++ topia/trunk/topia-soa/src/test/xmi/soaTest.properties 2009-02-10 08:36:15 UTC (rev 1348) @@ -0,0 +1 @@ +model.tagvalue.usecaseengineextendedclass=BasePage \ No newline at end of file Added: topia/trunk/topia-soa/src/test/xmi/soaTest.zargo =================================================================== (Binary files differ) Property changes on: topia/trunk/topia-soa/src/test/xmi/soaTest.zargo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: topia/trunk/topia-ui/pom.xml =================================================================== --- topia/trunk/topia-ui/pom.xml 2009-02-09 19:41:35 UTC (rev 1347) +++ topia/trunk/topia-ui/pom.xml 2009-02-10 08:36:15 UTC (rev 1348) @@ -117,7 +117,7 @@ <groupId>${project.groupId}</groupId> <artifactId>topia-persistence</artifactId> <version>${project.version}</version> - <scope>test</scope> + <scope>runtime</scope> </dependency> </dependencies> </plugin>