> {
8 | public void handleInbound(T ctx) throws ServletException, IOException;
9 |
10 | public void handleOutbound(T ctx) throws ServletException, IOException;
11 | }
12 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/java/org/unidal/codegen/framework/FileStorageTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | import org.junit.Test;
4 | import org.unidal.lookup.ComponentTestCase;
5 |
6 | public class FileStorageTest extends ComponentTestCase {
7 | @Test
8 | public void test() throws Exception {
9 | FileStorage storage = lookup(FileStorage.class);
10 |
11 | System.out.println(storage);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/ViewModel.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc;
2 |
3 | public abstract class ViewModel> {
4 | public ViewModel(M actionContext) {
5 | }
6 |
7 | public abstract A getDefaultAction();
8 |
9 | public void setAction(A action) {
10 | }
11 |
12 | public void setPage(P action) {
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/xpipe-keeper/model/keeper-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/ActionException.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc;
2 |
3 | public class ActionException extends Exception {
4 | private static final long serialVersionUID = 1L;
5 |
6 | public ActionException(String message) {
7 | super(message);
8 | }
9 |
10 | public ActionException(String message, Throwable cause) {
11 | super(message, cause);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/DalException.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc;
2 |
3 | public class DalException extends Exception {
4 | private static final long serialVersionUID = 7621577151593643911L;
5 |
6 | public DalException(String message) {
7 | super(message);
8 | }
9 |
10 | public DalException(String message, Throwable cause) {
11 | super(message, cause);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/framework/FileStorage.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | import java.io.IOException;
4 |
5 | import org.unidal.codegen.model.entity.OutputModel;
6 |
7 | public interface FileStorage {
8 | public void copyResources(GenerationContext ctx, OutputModel output) throws IOException;
9 |
10 | public void writeFile(GenerationContext ctx, OutputModel output, String content) throws IOException;
11 | }
12 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/resources/org/unidal/codegen/framework/structure.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/annotation/SubObjects.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.FIELD)
10 | public @interface SubObjects {
11 | String[] value();
12 | }
13 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/test/java/org/unidal/maven/plugin/source/AllTests.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.source;
2 |
3 | import org.junit.runner.RunWith;
4 | import org.junit.runners.Suite;
5 | import org.junit.runners.Suite.SuiteClasses;
6 | import org.unidal.maven.plugin.source.pipeline.SourcePipelineTest;
7 |
8 | @RunWith(Suite.class)
9 | @SuiteClasses({
10 |
11 | SourcePipelineTest.class,
12 |
13 | })
14 | public class AllTests {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/pixie/model/wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Home
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/ErrorActionMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.METHOD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(METHOD)
11 | public @interface ErrorActionMeta {
12 | String name();
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/phoenix-response/model/response-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/TransitionMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.METHOD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(METHOD)
11 | public @interface TransitionMeta {
12 | String name();
13 | }
14 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/payload/annotation/PathMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.payload.annotation;
2 |
3 | import static java.lang.annotation.ElementType.FIELD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(FIELD)
11 | public @interface PathMeta {
12 | String value();
13 | }
14 |
--------------------------------------------------------------------------------
/project-maven-plugin/src/test/java/org/unidal/maven/plugin/project/AllTests.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.project;
2 |
3 | import org.junit.runner.RunWith;
4 | import org.junit.runners.Suite;
5 | import org.junit.runners.Suite.SuiteClasses;
6 | import org.unidal.maven.plugin.project.rule.RuleEngineTest;
7 |
8 | @RunWith(Suite.class)
9 | @SuiteClasses({
10 |
11 | //MigrateMojoTest.class,
12 |
13 | RuleEngineTest.class
14 |
15 | })
16 | public class AllTests {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/main/java/org/unidal/maven/plugin/source/pipeline/SourceHandlerContext.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.source.pipeline;
2 |
3 | public interface SourceHandlerContext {
4 | public void fireEnd(SourceScope scope);
5 |
6 | public void fireLine(String line);
7 |
8 | public void fireStart(SourceScope scope);
9 |
10 | public SourceHandler handler();
11 |
12 | public SourcePipeline pipeline();
13 |
14 | public Source source();
15 | }
16 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/payload/annotation/ObjectMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.payload.annotation;
2 |
3 | import static java.lang.annotation.ElementType.FIELD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(FIELD)
11 | public @interface ObjectMeta {
12 | String value();
13 | }
14 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/model-all-sqlmap/model/sqlMap-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/payload/annotation/PathPatternMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.payload.annotation;
2 |
3 | import static java.lang.annotation.ElementType.TYPE;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(TYPE)
11 | public @interface PathPatternMeta {
12 | String value();
13 | }
14 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/OutboundActionMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.METHOD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(METHOD)
11 | public @interface OutboundActionMeta {
12 | String name();
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/PreInboundActionMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.METHOD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(METHOD)
11 | public @interface PreInboundActionMeta {
12 | String[] value();
13 | }
14 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/main/resources/META-INF/dal/model/structure.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/test/resources/org/unidal/maven/plugin/source/lines.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/hermes-meta/model/meta-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | public final static String LOCAL = "local";
7 | public final static String BROKER = "broker";
8 | public final static
9 | String TRANSACTION = "transaction";
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/framework/XmlAggregator.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 |
6 | import org.unidal.codegen.model.entity.Any;
7 | import org.unidal.codegen.model.entity.StructureModel;
8 | import org.unidal.codegen.model.entity.ManifestModel;
9 |
10 | public interface XmlAggregator {
11 | public Any aggregate(File manifestXml, StructureModel structure, ManifestModel manifest) throws IOException;
12 | }
13 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/annotation/Variable.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.FIELD)
10 | public @interface Variable {
11 | int sqlType() default Integer.MIN_VALUE;
12 |
13 | int scale() default 0;
14 | }
15 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/PayloadProvider.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc;
2 |
3 | import java.util.List;
4 |
5 | import org.unidal.web.lifecycle.UrlMapping;
6 | import org.unidal.web.mvc.payload.ParameterProvider;
7 |
8 | public interface PayloadProvider {
9 | public void register(Class> payloadClass);
10 |
11 | public List process(UrlMapping mapping, ParameterProvider parameterProvider, ActionPayload payload);
12 | }
13 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/Updateset.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc;
2 |
3 | import java.util.Arrays;
4 | import java.util.Collections;
5 | import java.util.List;
6 |
7 |
8 | public class Updateset {
9 | private List m_fields;
10 |
11 | public Updateset(DataField... fields) {
12 | m_fields = Collections.unmodifiableList(Arrays.asList(fields));
13 | }
14 |
15 | public List getFields() {
16 | return m_fields;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/annotation/Entity.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.TYPE)
10 | public @interface Entity {
11 | String logicalName();
12 |
13 | String physicalName() default "";
14 |
15 | String alias();
16 | }
17 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/java/org/unidal/maven/plugin/wizard/meta/TableMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.wizard.meta;
2 |
3 | import java.sql.DatabaseMetaData;
4 | import java.sql.SQLException;
5 |
6 | import org.jdom.Document;
7 | import org.jdom.Element;
8 |
9 | public interface TableMeta {
10 | public Element getTableMeta(DatabaseMetaData meta, String table) throws SQLException;
11 |
12 | public Document getModel(String packageName);
13 |
14 | public Document getManifest(String codegenXml, String modelXml);
15 | }
16 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/ModulePagesMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.TYPE;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | import org.unidal.web.mvc.PageHandler;
10 |
11 | @Retention(RUNTIME)
12 | @Target(TYPE)
13 | public @interface ModulePagesMeta {
14 | Class extends PageHandler>>[] value();
15 | }
16 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/phoenix-project/model/project-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/phoenix-rule/model/rule-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/view/HtmlTemplate.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.view;
2 |
3 | import java.io.IOException;
4 |
5 | import javax.servlet.ServletException;
6 |
7 | import org.unidal.lookup.annotation.Named;
8 | import org.unidal.web.mvc.ActionContext;
9 | import org.unidal.web.mvc.ViewModel;
10 |
11 | @Named
12 | public class HtmlTemplate {
13 |
14 | public void render(String template, ActionContext> ctx, ViewModel, ?, ?> model)
15 | throws ServletException, IOException {
16 |
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/META-INF/wizard/model/wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | src/test/resources/org/unidal/maven/plugin/wizard/wizard.xml
5 |
6 |
7 | src/test/resources/org/unidal/maven/plugin/wizard/template.xml
8 |
9 |
10 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/phoenix-rule/model/rule-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/InboundActionMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.METHOD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(METHOD)
11 | public @interface InboundActionMeta {
12 | String name();
13 |
14 | String transition() default "";
15 |
16 | String errorAction() default "";
17 | }
18 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/annotation/Relation.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.FIELD)
10 | public @interface Relation {
11 | String logicalName();
12 |
13 | String alias();
14 |
15 | String join();
16 |
17 | boolean multiple() default false;
18 | }
19 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/java/org/unidal/codegen/code/ObfuscaterTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.code;
2 |
3 | import org.junit.Assert;
4 | import org.junit.Test;
5 | import org.unidal.helper.Codes;
6 | import org.unidal.lookup.ComponentTestCase;
7 |
8 | public class ObfuscaterTest extends ComponentTestCase {
9 | @Test
10 | public void testEncode() throws Exception {
11 | Obfuscater o = lookup(Obfuscater.class);
12 | String str = o.encode("Hello, world!");
13 |
14 | Assert.assertEquals("Hello, world!", Codes.forDecode().decode(str));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/codegen/generator/wizard/phoenix/service-wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Home
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/codegen/generator/wizard/pixie/wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 | Home
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/java/org/unidal/codegen/framework/AllTests.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | import org.junit.runner.RunWith;
4 | import org.junit.runners.Suite;
5 | import org.junit.runners.Suite.SuiteClasses;
6 | import org.unidal.codegen.code.ObfuscaterTest;
7 |
8 | @RunWith(Suite.class)
9 | @SuiteClasses({
10 |
11 | FileStorageTest.class,
12 |
13 | XmlAggregatorTest.class,
14 |
15 | XslGeneratorTest.class,
16 |
17 | XslTransformerTest.class,
18 |
19 | ObfuscaterTest.class,
20 |
21 | })
22 | public class AllTests {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/lifecycle/UrlMapping.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.lifecycle;
2 |
3 | public interface UrlMapping {
4 | public String getAction();
5 |
6 | public String getContextPath();
7 |
8 | public String getModule();
9 |
10 | public String getPathInfo();
11 |
12 | public String getQueryString();
13 |
14 | public String getRawAction();
15 |
16 | public String getRawModule();
17 |
18 | public String getServletPath();
19 |
20 | public void setAction(String action);
21 |
22 | public void setModule(String module);
23 | }
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/tulip-scenario/model/scenarios-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/ValidationMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.METHOD;
4 | import static java.lang.annotation.ElementType.TYPE;
5 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
6 |
7 | import java.lang.annotation.Retention;
8 | import java.lang.annotation.Target;
9 |
10 | import org.unidal.web.mvc.Validator;
11 |
12 | @Retention(RUNTIME)
13 | @Target({ METHOD, TYPE })
14 | public @interface ValidationMeta {
15 | Class extends Validator>>[] value();
16 | }
17 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/codegen/generator/wizard/phoenix/environment-wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Status
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/main/java/org/unidal/maven/plugin/source/pipeline/Source.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.source.pipeline;
2 |
3 | import java.io.File;
4 |
5 | import org.apache.maven.project.MavenProject;
6 |
7 | public interface Source {
8 | String getClassName();
9 |
10 | File getFile();
11 |
12 | File getFolder();
13 |
14 | String getLine();
15 |
16 | MavenProject getModule();
17 |
18 | String getPackage();
19 |
20 | SourceScope getParentScope();
21 |
22 | MavenProject getProject();
23 |
24 | SourceScope getScope();
25 |
26 | String getSourceRoot();
27 |
28 | SourcePipeline pipeline();
29 | }
30 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/ebay-request/model/AddItemRequest-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/PayloadMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.METHOD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | import org.unidal.web.mvc.Action;
10 | import org.unidal.web.mvc.ActionPayload;
11 | import org.unidal.web.mvc.Page;
12 |
13 | @Retention(RUNTIME)
14 | @Target(METHOD)
15 | public @interface PayloadMeta {
16 | Class extends ActionPayload extends Page, ? extends Action>> value();
17 | }
18 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/dianping-zebra-config/model/system-config-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/pixie-single/model/single-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/main/java/org/unidal/maven/plugin/codegen/function/Collection.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.codegen.function;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | public class Collection {
7 | private static List s_values = new ArrayList();
8 |
9 | public static boolean addIfAbsent(String value) {
10 | if (value == null || value.length() == 0) {
11 | return false;
12 | } else if (s_values.contains(value)) {
13 | return false;
14 | } else {
15 | s_values.add(value);
16 | return true;
17 | }
18 | }
19 |
20 | public static void reset() {
21 | s_values.clear();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/ebay-response/model/AddItemResponse-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/main/java/org/unidal/maven/plugin/source/pipeline/SourceScope.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.source.pipeline;
2 |
3 | public enum SourceScope {
4 | PROJECT,
5 |
6 | MODULE,
7 |
8 | SOURCE,
9 |
10 | TEST_SOURCE,
11 |
12 | RESOURCE,
13 |
14 | TEST_RESOURCE,
15 |
16 | FILE;
17 |
18 | public boolean isFile() {
19 | return this == FILE;
20 | }
21 |
22 | public boolean isProject() {
23 | return this == PROJECT;
24 | }
25 |
26 | public boolean isSource() {
27 | return this == SOURCE || this == TEST_SOURCE;
28 | }
29 |
30 | public boolean isTest() {
31 | return this == TEST_SOURCE || this == TEST_RESOURCE;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/META-INF/wizard/webapp/wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Home
7 |
8 |
9 | Single
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/payload/annotation/PayloadProviderMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.payload.annotation;
2 |
3 | import static java.lang.annotation.ElementType.TYPE;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | import org.unidal.web.mvc.Action;
10 | import org.unidal.web.mvc.Page;
11 | import org.unidal.web.mvc.PayloadProvider;
12 |
13 | @Retention(RUNTIME)
14 | @Target(TYPE)
15 | public @interface PayloadProviderMeta {
16 | Class extends PayloadProvider extends Page, ? extends Action>> value();
17 | }
18 |
--------------------------------------------------------------------------------
/project-maven-plugin/src/main/java/org/unidal/maven/plugin/project/rule/RuleConfigurator.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.project.rule;
2 |
3 | public class RuleConfigurator {
4 | public void configure(RuleRegistry registry) {
5 | for (ClassRule rule : ClassRule.values()) {
6 | registry.register(rule);
7 | }
8 |
9 | for (FieldRule rule : FieldRule.values()) {
10 | registry.register(rule);
11 | }
12 |
13 | for (ConstructorRule rule : ConstructorRule.values()) {
14 | registry.register(rule);
15 | }
16 |
17 | for (MethodRule rule : MethodRule.values()) {
18 | registry.register(rule);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/payload/ParameterProvider.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.payload;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 |
8 | public interface ParameterProvider {
9 | public InputStream getFile(String name) throws IOException;
10 |
11 | public String getModuleName();
12 |
13 | public String[] getParameterNames();
14 |
15 | public String getParameter(String name);
16 |
17 | public String[] getParameterValues(String name);
18 |
19 | public HttpServletRequest getRequest();
20 |
21 | public ParameterProvider setRequest(HttpServletRequest request);
22 | }
23 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat2-tenant-report/test-resources/tenant-report.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/AbstractModule.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc;
2 |
3 | import org.unidal.web.mvc.annotation.ErrorActionMeta;
4 | import org.unidal.web.mvc.annotation.TransitionMeta;
5 |
6 | public abstract class AbstractModule implements Module {
7 | public Class extends PageHandler>>[] getPageHandlers() {
8 | return null;
9 | }
10 |
11 | @TransitionMeta(name = "default")
12 | public void handleTransition(ActionContext> ctx) {
13 | // simple cases, nothing here
14 | }
15 |
16 | @ErrorActionMeta(name = "default")
17 | public void onError(ActionContext> ctx) {
18 | // ignore error, leave MVC to handle it
19 | }
20 | }
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/main/java/org/unidal/maven/plugin/codegen/function/Normalizer.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.codegen.function;
2 |
3 | public class Normalizer {
4 | public static String normalize(String str) {
5 | int len = str.length();
6 | StringBuilder sb = new StringBuilder(len);
7 | boolean upper = false;
8 |
9 | for (int i = 0; i < len; i++) {
10 | char ch = str.charAt(i);
11 |
12 | if (ch == '-' || ch == '_' || ch == ':') {
13 | upper = true;
14 | } else {
15 | if (upper) {
16 | sb.append(Character.toUpperCase(ch));
17 | upper = false;
18 | } else {
19 | sb.append(ch);
20 | }
21 | }
22 | }
23 |
24 | return sb.toString();
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/catconfig/web-2.3-after.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | cat-filter
7 | com.dianping.cat.servlet.CatFilter
8 |
9 |
10 | cat-filter
11 | /*
12 |
13 |
14 | com.dianping.cat.servlet.CatListener
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/ebay-service/test-resources/AddItem.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ABC...123
5 |
6 | -
7 | 500.0
8 | 1000
9 | US
10 |
11 |
12 |
13 | Success
14 | 110071690410
15 |
16 |
17 | InsertionFee
18 | 0.5
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/pixie-single/model/single-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/main/java/org/unidal/maven/plugin/source/pipeline/SourceHandlerAdaptor.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.source.pipeline;
2 |
3 | public class SourceHandlerAdaptor implements SourceHandler {
4 | protected SourceHandlerContext getContext(SourceHandlerContext ctx) {
5 | return ctx;
6 | }
7 |
8 | @Override
9 | public void handleLine(SourceHandlerContext ctx, String line) {
10 | getContext(ctx).fireLine(line);
11 | }
12 |
13 | @Override
14 | public void handleEnd(SourceHandlerContext ctx, SourceScope scope) {
15 | getContext(ctx).fireEnd(scope);
16 | }
17 |
18 | @Override
19 | public void handleStart(SourceHandlerContext ctx, SourceScope scope) {
20 | getContext(ctx).fireStart(scope);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/main/java/org/unidal/maven/plugin/source/lines/IVisitor.java:
--------------------------------------------------------------------------------
1 | /* THIS FILE WAS AUTO GENERATED BY codegen-maven-plugin, DO NOT EDIT IT */
2 | package org.unidal.maven.plugin.source.lines;
3 |
4 | import org.unidal.maven.plugin.source.lines.entity.ClassModel;
5 | import org.unidal.maven.plugin.source.lines.entity.CountModel;
6 | import org.unidal.maven.plugin.source.lines.entity.ProjectModel;
7 | import org.unidal.maven.plugin.source.lines.entity.RootModel;
8 |
9 | public interface IVisitor {
10 |
11 | public void visitClass(ClassModel _class);
12 |
13 | public void visitCount(CountModel count);
14 |
15 | public void visitProject(ProjectModel project);
16 |
17 | public void visitRoot(RootModel root);
18 | }
19 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/codegen/generator/wizard/phoenix/console-wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Home
6 |
7 |
8 | Deploy
9 |
10 |
11 | Version
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/annotation/Attribute.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.FIELD)
10 | public @interface Attribute {
11 | String field();
12 |
13 | boolean primaryKey() default false;
14 |
15 | boolean nullable() default true;
16 |
17 | boolean autoIncrement() default false;
18 |
19 | String selectExpr() default "";
20 |
21 | String insertExpr() default "";
22 |
23 | String updateExpr() default "";
24 | }
25 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/draft/org/unidal/codegen/generator/model/cat/NativeTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.generator.model.cat;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 |
6 | import org.junit.Test;
7 | import org.xml.sax.SAXException;
8 |
9 | import com.dianping.cat.consumer.transaction.model.entity.TransactionReport;
10 | import com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser;
11 |
12 | public class NativeTest {
13 | @Test
14 | public void test() throws SAXException, IOException {
15 | InputStream in = getClass().getResourceAsStream("/transaction.xml");
16 | TransactionReport report = DefaultSaxParser.parse(in);
17 |
18 | System.out.println(report);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/resources/org/unidal/codegen/framework/xsl/entity.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat-heartbeat-report/model/heartbeat-report-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/java/org/unidal/maven/plugin/wizard/ProjectMojoTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.wizard;
2 |
3 | import java.io.File;
4 |
5 | import org.apache.maven.plugin.MojoExecutionException;
6 | import org.apache.maven.plugin.MojoFailureException;
7 | import org.junit.Test;
8 |
9 | public class ProjectMojoTest {
10 | @Test
11 | public void test() throws MojoExecutionException, MojoFailureException {
12 | ProjectMojo mojo = new ProjectMojo();
13 |
14 | mojo.groupId = "org.unidal.test";
15 | mojo.artifactId = "test";
16 | mojo.version = "1.0";
17 | mojo.packaging = "pom";
18 | mojo.name = "Test";
19 | mojo.m_pomFile = new File("target/pom.xml");
20 |
21 | mojo.execute();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/resources/org/unidal/codegen/framework/abstract.txt:
--------------------------------------------------------------------------------
1 | resource: meta.xml => meta.xml
2 | code: meta.java => meta
3 | code: tenants.java => tenants
4 | code: organization.java => organization
5 | code: tenant.java => tenant
6 | code: domain.java => domain
7 | code: process.java => process
8 | code: workers.java => workers
9 | code: worker.java => worker
10 | code: workload.java => workload
11 | code: scenarios.java => scenarios
12 | code: scenario.java => scenario
13 | code: query.java => query
14 | code: condition.java => condition
15 | code: field.java => field
16 | code: configure.java => configure
17 | code: configs.java => configs
18 | code: config.java => config
19 | code: events.java => events
20 | code: event.java => event
21 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/payload/annotation/FieldMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.payload.annotation;
2 |
3 | import static java.lang.annotation.ElementType.FIELD;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | @Retention(RUNTIME)
10 | @Target(FIELD)
11 | public @interface FieldMeta {
12 | public static final String NOT_SPECIFIED = "NOT_SPECIFIED";
13 |
14 | String defaultValue() default NOT_SPECIFIED;
15 |
16 | String format() default "";
17 |
18 | boolean file() default false; // file of multipart/form-data
19 |
20 | boolean raw() default false; // raw request content
21 |
22 | String value();
23 | }
24 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/ModuleMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.TYPE;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | import org.unidal.web.lifecycle.ActionResolver;
10 |
11 | @Retention(RUNTIME)
12 | @Target(TYPE)
13 | public @interface ModuleMeta {
14 | String name();
15 |
16 | String defaultInboundAction() default "";
17 |
18 | String defaultTransition() default "";
19 |
20 | String defaultErrorAction() default "";
21 |
22 | Class extends ActionResolver> actionResolver() default ActionResolver.class;
23 | }
24 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/jdbc-pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dianping.test
5 | parent
6 | 0.1.0
7 |
8 | 4.0.0
9 | test-server
10 | Test Server
11 |
12 |
13 | junit
14 | junit
15 | test
16 |
17 |
18 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/model-pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dianping.test
5 | parent
6 | 0.1.0
7 |
8 | 4.0.0
9 | test-server
10 | Test Server
11 |
12 |
13 | junit
14 | junit
15 | test
16 |
17 |
18 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/webapp-pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dianping.test
5 | parent
6 | 0.1.0
7 |
8 | 4.0.0
9 | test-server
10 | Test Server
11 |
12 |
13 | junit
14 | junit
15 | test
16 |
17 |
18 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/AbstractDao.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc;
2 |
3 | import org.unidal.lookup.ContainerHolder;
4 | import org.unidal.lookup.annotation.Inject;
5 | import org.unidal.lookup.extension.Initializable;
6 | import org.unidal.lookup.extension.InitializationException;
7 |
8 | public abstract class AbstractDao extends ContainerHolder implements Initializable {
9 | @Inject
10 | private QueryEngine m_queryEngine;
11 |
12 | protected QueryEngine getQueryEngine() {
13 | return m_queryEngine;
14 | }
15 |
16 | protected abstract Class>[] getEntityClasses();
17 |
18 | public void initialize() throws InitializationException {
19 | m_queryEngine = lookup(QueryEngine.class);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/egret-project/model/projects-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/framework/FileMode.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | public enum FileMode {
4 | CREATE_OR_OVERWRITE("create_or_overwrite"),
5 |
6 | CREATE_IF_NOT_EXISTS("create_if_not_exists");
7 |
8 | private String m_name;
9 |
10 | private FileMode(String name) {
11 | m_name = name;
12 | }
13 |
14 | public String getName() {
15 | return m_name;
16 | }
17 |
18 | public static FileMode getByName(String name) {
19 | for (FileMode mode : FileMode.values()) {
20 | if (mode.getName().equalsIgnoreCase(name)) {
21 | return mode;
22 | }
23 | }
24 |
25 | throw new IllegalArgumentException("No FileMode defined for " + name);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/tulip-graphql/model/graphql-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/pom/jdbc-pom-before.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dianping.test
5 | parent
6 | 0.1.0
7 |
8 | 4.0.0
9 | test-server
10 | Test Server
11 |
12 |
13 | junit
14 | junit
15 | test
16 |
17 |
18 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/pom/model-pom-before.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dianping.test
5 | parent
6 | 0.1.0
7 |
8 | 4.0.0
9 | test-server
10 | Test Server
11 |
12 |
13 | junit
14 | junit
15 | test
16 |
17 |
18 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/pom/webapp-pom-before.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dianping.test
5 | parent
6 | 0.1.0
7 |
8 | 4.0.0
9 | test-server
10 | Test Server
11 |
12 |
13 | junit
14 | junit
15 | test
16 |
17 |
18 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/dobby-model/model/model-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/garden/model/wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Home Page of Garden
6 |
7 |
8 | Technical Trends
9 |
10 |
11 |
12 |
13 | Database Query Toolkit
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/framework/OperationMode.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | public enum OperationMode {
4 | APPLY_TEMPLATE("apply_template"),
5 |
6 | COPY_RESOURCES("copy_resources");
7 |
8 | private String m_name;
9 |
10 | private OperationMode(String name) {
11 | m_name = name;
12 | }
13 |
14 | public static OperationMode getByName(String name) {
15 | for (OperationMode mode : OperationMode.values()) {
16 | if (mode.getName().equalsIgnoreCase(name)) {
17 | return mode;
18 | }
19 | }
20 |
21 | throw new IllegalArgumentException("No OperationMode defined for " + name);
22 | }
23 |
24 | public String getName() {
25 | return m_name;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/webapp/sources/org/unidal/web/mvc/annotation/PageMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.web.mvc.annotation;
2 |
3 | import static java.lang.annotation.ElementType.TYPE;
4 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
5 |
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.Target;
8 |
9 | import org.unidal.web.lifecycle.ActionResolver;
10 |
11 | @Retention(RUNTIME)
12 | @Target(TYPE)
13 | public @interface PageMeta {
14 | String name();
15 |
16 | String module();
17 |
18 | String defaultInboundAction() default "";
19 |
20 | String defaultTransition() default "";
21 |
22 | String defaultErrorAction() default "";
23 |
24 | Class extends ActionResolver> actionResolver() default ActionResolver.class;
25 | }
26 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/test/java/org/unidal/maven/plugin/source/LinesMojoTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.source;
2 |
3 | import java.io.File;
4 |
5 | import org.apache.maven.project.MavenProject;
6 | import org.junit.Test;
7 | import org.unidal.helper.Reflects;
8 |
9 | public class LinesMojoTest {
10 | @Test
11 | public void testMojo() throws Exception {
12 | LinesMojo mojo = new LinesMojo();
13 | MavenProject project = new MavenProject();
14 |
15 | project.setName("mock-project");
16 | project.getCompileSourceRoots().add(new File("src/main/java").getCanonicalPath());
17 | project.getTestCompileSourceRoots().add(new File("src/test/java").getCanonicalPath());
18 |
19 | Reflects.forField().setDeclaredFieldValue(LinesMojo.class, "m_project", mojo, project);
20 |
21 | mojo.execute();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/tulip-graphql/model/graphql-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/plexus-maven-plugin/src/test/resources/org/unidal/maven/plugin/codegen/plexus/profile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | v10
5 | v20
6 | v30
7 |
8 |
9 | v11
10 | v21
11 | v31
12 |
13 |
14 | v12
15 | v22
16 | v32
17 |
18 |
19 | v13
20 | v23
21 | v33
22 |
23 |
24 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/DataField.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc;
2 |
3 | public class DataField {
4 | private Class> m_entityClass;
5 |
6 | private int m_index;
7 |
8 | private String m_name;
9 |
10 | public DataField(String name) {
11 | m_name = name;
12 | }
13 |
14 | public Class> getEntityClass() {
15 | return m_entityClass;
16 | }
17 |
18 | public int getIndex() {
19 | return m_index;
20 | }
21 |
22 | public String getName() {
23 | return m_name;
24 | }
25 |
26 | public void setEntityClass(Class> entityClass) {
27 | m_entityClass = entityClass;
28 | }
29 |
30 | public void setIndex(int index) {
31 | m_index = index;
32 | }
33 |
34 | @Override
35 | public String toString() {
36 | return m_name;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/wizard/jdbc/structure.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/wizard/webapp/structure.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat-ip-report/model/ip-report-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/framework/GenerationContext.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | import java.io.File;
4 | import java.net.URL;
5 | import java.util.Map;
6 | import java.util.concurrent.atomic.AtomicInteger;
7 |
8 | public interface GenerationContext {
9 | public void debug(String message);
10 |
11 | public URL getDecorateXsl();
12 |
13 | public File getFile(String file);
14 |
15 | public AtomicInteger getGeneratedFiles();
16 |
17 | public File getManifestXml();
18 |
19 | public URL getManifestXsl();
20 |
21 | public URL getNormalizeXsl();
22 |
23 | public Map getProperties();
24 |
25 | public URL getStructureXml();
26 |
27 | public URL getTemplateXsl(String template);
28 |
29 | public void info(String message);
30 |
31 | public void verbose(String message);
32 | }
33 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/cat2-alert/model/alert-dal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
9 | FROM
10 | WHERE = ${name}
11 | ]]>
12 |
13 |
14 |
15 |
17 | SET
18 | WHERE = ${name}
19 | ]]>
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/dianping-deployment/model/deployment-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat-threshold-template/model/threshold-template-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/cat2-config/model/system-dal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
9 | FROM
10 | WHERE = ${name}
11 | ]]>
12 |
13 |
14 |
15 |
17 | SET
18 | WHERE = ${name}
19 | ]]>
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/resources/org/unidal/codegen/generator/model/test/eunit_resource_codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/project-maven-plugin/src/main/java/org/unidal/maven/plugin/project/rule/IRule.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.project.rule;
2 |
3 | import java.lang.reflect.AnnotatedElement;
4 | import java.util.Comparator;
5 |
6 | public interface IRule extends Comparator {
7 | public String getName();
8 |
9 | public RuleType getType();
10 |
11 | /**
12 | * Compare the two annotated elements(Class, Field, Constructor and Method) to determine the back compatibility.
13 | *
14 | * @param source
15 | * current annotated element to compare
16 | * @param target
17 | * the baseline annotated element to compare
18 | * @return an int < 0 is error code if source is NOT compatible with target, 0 means they are compatible or skipped,
19 | * and > 0 is reason code when the comparison is stopped
20 | */
21 | public int compare(T source, T target);
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/resources/org/unidal/codegen/codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/resources/org/unidal/codegen/framework/xsl/decorate.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | true
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/jdbc/garden/model/wizard.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.mysql.jdbc.Driver
5 | jdbc:mysql://localhost:3306/cat
6 | cat
7 | cat
8 | useUnicode=true&autoReconnect=true
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/resources/org/unidal/codegen/framework/xsl/normalize.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | true
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/main/resources/META-INF/dal/jdbc/xsl/naming.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/main/resources/META-INF/dal/model/xsl/naming.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/dianping-zebra-config/model/system-config-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/wizard/jdbc/xsl/naming.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/java/org/unidal/maven/plugin/AllTests.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin;
2 |
3 | import org.junit.runner.RunWith;
4 | import org.junit.runners.Suite;
5 | import org.junit.runners.Suite.SuiteClasses;
6 | import org.unidal.maven.plugin.property.PropertyProviderTest;
7 | import org.unidal.maven.plugin.wizard.meta.ModelMetaTest;
8 | import org.unidal.maven.plugin.wizard.meta.TableMetaTest;
9 | import org.unidal.maven.plugin.wizard.pom.JdbcPomBuilderTest;
10 | import org.unidal.maven.plugin.wizard.pom.ModelPomBuilderTest;
11 | import org.unidal.maven.plugin.wizard.pom.WebAppPomBuilderTest;
12 |
13 | @RunWith(Suite.class)
14 | @SuiteClasses({
15 |
16 | PropertyProviderTest.class,
17 |
18 | ModelMetaTest.class,
19 |
20 | TableMetaTest.class,
21 |
22 | JdbcPomBuilderTest.class,
23 |
24 | ModelPomBuilderTest.class,
25 |
26 | WebAppPomBuilderTest.class,
27 |
28 | })
29 | public class AllTests {
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/wizard/webapp/xsl/naming.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat-bug/model/bug-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/plexus-maven-plugin/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | org.unidal.maven.plugins
5 | parent
6 | 6.0.0
7 |
8 | 4.0.0
9 | plexus-maven-plugin
10 | maven-plugin
11 | Plexus Maven Plugin
12 |
13 |
14 | ${project.groupId}
15 | codegen-foundation
16 |
17 |
18 | junit
19 | junit
20 | test
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | org.unidal.maven.plugins
5 | parent
6 | 6.0.0
7 |
8 | 4.0.0
9 | codegen-maven-plugin
10 | maven-plugin
11 | Code Generation Maven Plugin
12 |
13 |
14 | ${project.groupId}
15 | codegen-foundation
16 |
17 |
18 | junit
19 | junit
20 | test
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/resources/org/unidal/codegen/generator/model/test/eunit_excel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/java/org/unidal/maven/plugin/wizard/meta/DefaultWizardMeta.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.wizard.meta;
2 |
3 | import java.io.Reader;
4 |
5 | import org.jdom.Document;
6 | import org.jdom.Element;
7 | import org.jdom.input.SAXBuilder;
8 | import org.unidal.lookup.annotation.Named;
9 |
10 | @Named(type = WizardMeta.class)
11 | public class DefaultWizardMeta implements WizardMeta {
12 | @Override
13 | public Document getWizard(Reader reader) {
14 | SAXBuilder builder = new SAXBuilder();
15 |
16 | try {
17 | return builder.build(reader);
18 | } catch (Exception e) {
19 | throw new RuntimeException("Error to build Document. " + e, e);
20 | }
21 | }
22 |
23 | @Override
24 | public Document getManifest(String wizardXml) {
25 | Element manifest = new Element("manifest");
26 |
27 | manifest.addContent(new Element("file").setAttribute("path", wizardXml));
28 | return new Document(manifest);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/plexus-model/model/plexus-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/resources/org/unidal/codegen/framework/xsl/template.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | package ;
17 |
18 | public class {
19 | }
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat-ip-report/model/ip-report-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/tulip-scenario/model/scenarios-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/wizard/webapp/xsl/test/all-tests.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | package ;
17 |
18 | import org.junit.runner.RunWith;
19 | import org.junit.runners.Suite;
20 | import org.junit.runners.Suite.SuiteClasses;
21 |
22 | @RunWith(Suite.class)
23 | @SuiteClasses({
24 |
25 | // add test classes here
26 |
27 | })
28 | public class AllTests {
29 |
30 | }
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat2-client-config/model/client-config-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/dianping-deployment/model/deployment-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/phoenix-deploy/model/deploy-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/xpipe-keeper/model/keeper-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/java/org/unidal/maven/plugin/property/SystemPropertyProvider.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.property;
2 |
3 | /**
4 | * Get property from Java System Properties.
5 | */
6 | public class SystemPropertyProvider extends AbstractPropertyProvider {
7 | public SystemPropertyProvider(String... mappings) {
8 | super(mappings);
9 | }
10 |
11 | /**
12 | * Get property value.
13 | *
14 | * @param property
15 | * property name
16 | * @return property value, null if property is not found, or property name is empty
17 | */
18 | @Override
19 | public String getProperty(String property, String defaultValue) {
20 | String name = map(property);
21 | String value = null;
22 |
23 | if (name != null) {
24 | if (name.length() > 0) {
25 | value = System.getProperty(name);
26 | }
27 | } else {
28 | value = System.getProperty(property);
29 | }
30 |
31 | if (value == null) {
32 | return defaultValue;
33 | } else {
34 | return value;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/java/org/unidal/maven/plugin/wizard/meta/TableMetaTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.wizard.meta;
2 |
3 | import org.junit.Assert;
4 | import org.junit.Test;
5 |
6 | public class TableMetaTest {
7 | @Test
8 | public void testNormalizeFieldName() {
9 | DefaultTableMeta meta = new DefaultTableMeta();
10 |
11 | Assert.assertEquals("field-name", meta.normalize("fieldName"));
12 | Assert.assertEquals("field-name", meta.normalize("FieldName"));
13 | Assert.assertEquals("field-name", meta.normalize("field-name"));
14 | Assert.assertEquals("field-name", meta.normalize("field-Name"));
15 | Assert.assertEquals("field-name", meta.normalize("Field-Name"));
16 | Assert.assertEquals("field-name", meta.normalize("field_name"));
17 | Assert.assertEquals("field-name", meta.normalize("field_Name"));
18 | Assert.assertEquals("field-name", meta.normalize("Field_Name"));
19 |
20 | Assert.assertEquals("field-name", meta.normalize("FIELD-NAME"));
21 | Assert.assertEquals("field-name", meta.normalize("FIELD_NAME"));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/java/org/unidal/maven/plugin/property/EnvironmentVariableProvider.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.property;
2 |
3 | /**
4 | * Get property from OS Environment Variable.
5 | */
6 | public class EnvironmentVariableProvider extends AbstractPropertyProvider {
7 | public EnvironmentVariableProvider(String... mappings) {
8 | super(mappings);
9 | }
10 |
11 | /**
12 | * Get property value.
13 | *
14 | * @param property
15 | * property name
16 | * @return property value, null if property is not found, or property name is empty
17 | */
18 | @Override
19 | public String getProperty(String property, String defaultValue) {
20 | String name = map(property);
21 | String value = null;
22 |
23 | if (name != null) {
24 | if (name.length() > 0) {
25 | value = System.getenv(name);
26 | }
27 | } else {
28 | value = System.getenv(property);
29 | }
30 |
31 | if (value == null) {
32 | return defaultValue;
33 | } else {
34 | return value;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat-threshold-template/model/threshold-template-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/plexus-maven-plugin/src/test/java/bootstrap/BootstrapTest.java:
--------------------------------------------------------------------------------
1 | package bootstrap;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 | import java.util.Arrays;
6 | import java.util.List;
7 |
8 | import org.junit.Test;
9 |
10 | public class BootstrapTest {
11 | public static void main(String[] args) throws Exception {
12 | Bootstrap.main(null);
13 | }
14 |
15 | @Test
16 | public void testUnzipWar() throws IOException {
17 | Bootstrap b = new Bootstrap();
18 | File warRoot = new File("target/work");
19 | File warFile = new File("cat.war");
20 |
21 | b.unzipWar(warRoot, warFile);
22 | }
23 |
24 | @Test
25 | public void testSetup() throws Exception {
26 | Bootstrap b = new Bootstrap();
27 | List entries = b.setup(new File("target/work"), "cat.war");
28 |
29 | System.out.println("Jars: " + (entries.size() - 1));
30 | }
31 |
32 | @Test
33 | public void testHackClassLoader() throws Exception {
34 | Bootstrap b = new Bootstrap();
35 |
36 | b.hackClassLoader(Arrays.asList("cat.war"));
37 |
38 | System.out.println(getClass().getResource("/WEB-INF/web.xml"));
39 |
40 | // b.startup(new File("target/work"), null);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/phoenix-response/model/response-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/hermes-meta/model/meta-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/Readset.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Arrays;
5 | import java.util.Collections;
6 | import java.util.List;
7 |
8 | public class Readset {
9 | private List m_fields;
10 |
11 | private List> m_readsets;
12 |
13 | public Readset(DataField... fields) {
14 | m_fields = Collections.unmodifiableList(Arrays.asList(fields));
15 | m_readsets = Collections.emptyList();
16 | }
17 |
18 | @SuppressWarnings("unchecked")
19 | public Readset(Readset>... readsets) {
20 | List> children = new ArrayList>();
21 |
22 | for (Readset> readset : readsets) {
23 | Readset rs = (Readset) readset;
24 |
25 | children.add(rs);
26 | children.addAll(rs.getChildren());
27 | }
28 |
29 | m_readsets = children;
30 | m_fields = Collections.emptyList();
31 | }
32 |
33 | public List getFields() {
34 | return m_fields;
35 | }
36 |
37 | public List> getChildren() {
38 | return m_readsets;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/wizard/webapp/xsl/page/jsp-file.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | package ;
19 |
20 | public enum {
21 | VIEW(""),
22 |
23 | ;
24 |
25 | private String m_path;
26 |
27 | private JspFile(String path) {
28 | m_path = path;
29 | }
30 |
31 | public String getPath() {
32 | return m_path;
33 | }
34 | }
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/main/resources/META-INF/dal/jdbc/structure.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/main/resources/META-INF/dal/model/xsl/ientity.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | /* THIS FILE WAS AUTO GENERATED BY codegen-maven-plugin, DO NOT EDIT IT */
17 | package ;
18 |
19 | public interface IEntity {
20 | public void accept(IVisitor visitor);
21 |
22 | public void mergeAttributes(T other);
23 |
24 | }
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/model/IVisitor.java:
--------------------------------------------------------------------------------
1 | /* THIS FILE WAS AUTO GENERATED BY codegen-maven-plugin, DO NOT EDIT IT */
2 | package org.unidal.codegen.model;
3 |
4 | import org.unidal.codegen.model.entity.Any;
5 | import org.unidal.codegen.model.entity.CodegenModel;
6 | import org.unidal.codegen.model.entity.FileModel;
7 | import org.unidal.codegen.model.entity.ManifestModel;
8 | import org.unidal.codegen.model.entity.NodeModel;
9 | import org.unidal.codegen.model.entity.OutputModel;
10 | import org.unidal.codegen.model.entity.OutputsModel;
11 | import org.unidal.codegen.model.entity.PropertyModel;
12 | import org.unidal.codegen.model.entity.StructureModel;
13 |
14 | public interface IVisitor {
15 |
16 | public void visitAny(Any any);
17 |
18 | public void visitCodegen(CodegenModel codegen);
19 |
20 | public void visitFile(FileModel file);
21 |
22 | public void visitManifest(ManifestModel manifest);
23 |
24 | public void visitNode(NodeModel node);
25 |
26 | public void visitOutput(OutputModel output);
27 |
28 | public void visitOutputs(OutputsModel outputs);
29 |
30 | public void visitProperty(PropertyModel property);
31 |
32 | public void visitStructure(StructureModel structure);
33 | }
34 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/expense-book/model/book-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/phoenix-project/model/project-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/QueryEngine.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc;
2 |
3 | import java.util.List;
4 |
5 | public interface QueryEngine {
6 | public String HINT_QUERY = "QUERY";
7 |
8 | public String HINT_DATA_OBJECT = "DATA_OBJECT";
9 |
10 | public int[] deleteBatch(QueryDef query, T[] protos) throws DalException;
11 |
12 | public int deleteSingle(QueryDef query, T proto) throws DalException;
13 |
14 | public int[] insertBatch(QueryDef query, T[] protos) throws DalException;
15 |
16 | public int insertSingle(QueryDef query, T proto) throws DalException;
17 |
18 | public List queryMultiple(QueryDef query, T proto, Readset> readset) throws DalException;
19 |
20 | public T querySingle(QueryDef query, T proto, Readset> readset) throws DalException;
21 |
22 | public int[] updateBatch(QueryDef query, T[] protos, Updateset> updateset) throws DalException;
23 |
24 | public int updateSingle(QueryDef query, T proto, Updateset> updateset) throws DalException;
25 | }
26 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/wizard/webapp/xsl/page/context.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | package ;
19 |
20 | import .;
21 |
22 | public class extends {
23 |
24 | }
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/wizard-model/model/wizard-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/main/resources/META-INF/dal/model/lines-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat-client/model/client-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/ebay-service/model/AddItem-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/java/org/unidal/maven/plugin/property/AbstractPropertyProvider.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.property;
2 |
3 | import java.util.Arrays;
4 | import java.util.HashMap;
5 | import java.util.Map;
6 |
7 | public abstract class AbstractPropertyProvider implements PropertyProvider {
8 | private Map m_property2Prompts = new HashMap();
9 |
10 | public AbstractPropertyProvider(String[] mappings) {
11 | m_property2Prompts = toMap(mappings);
12 | }
13 |
14 | protected String map(String property) {
15 | return m_property2Prompts.get(property);
16 | }
17 |
18 | private Map toMap(String[] mappings) {
19 | Map map = new HashMap(mappings.length * 2);
20 |
21 | for (String mapping : mappings) {
22 | int pos = mapping.indexOf(':');
23 |
24 | if (pos > 0) {
25 | String key = mapping.substring(0, pos);
26 | String value = mapping.substring(pos + 1);
27 |
28 | map.put(key, value);
29 | } else {
30 | throw new IllegalArgumentException(String.format("Invalid mappings: %s.", Arrays.asList(mappings)));
31 | }
32 | }
33 |
34 | return map;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/dal/model/wizard-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/main/resources/META-INF/dal/model/xsl/ivisitor_enabled.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | /* THIS FILE WAS AUTO GENERATED BY codegen-maven-plugin, DO NOT EDIT IT */
16 | package ;
17 |
18 | public interface IVisitorEnabled {
19 | public void enableVisitor(IVisitor visitor);
20 | }
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat2-client-config/model/client-config-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/resources/org/unidal/codegen/generator/model/test/eunit_resource_sample.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Test Scenario 1
4 | ]]>
5 | ]]>
6 |
7 |
8 | Test Scenario 2
9 | ]]>
10 |
11 | Unsupported property(ABC) for resource(com.ebay.esf.resource.css.LocalCssResource) with uri(css.local:/mystyle_css#ABC).
12 | Unsupported property(ABC) for resource({0})
13 |
14 |
15 | Unsupported property(ABC) for resource(com.ebay.esf.resource.css.LocalCssResource) with uri(css.local:/mystyle_css#ABC).
16 | Unsupported property(ABC) for resource({0})
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/dianping-liger-datasource/model/datasource-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/test/java/org/unidal/maven/plugin/source/UpgradeMojoTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.source;
2 |
3 | import java.io.File;
4 |
5 | import org.apache.maven.project.MavenProject;
6 | import org.junit.Test;
7 | import org.unidal.helper.Reflects;
8 |
9 | public class UpgradeMojoTest {
10 | private File m_rootDir = new File("/Users/qmwu2000/project/unidal/cat-next");
11 |
12 | @Test
13 | public void testOne() throws Exception {
14 | checkProject("cat-meta-service");
15 | }
16 |
17 | @Test
18 | public void testAll() throws Exception {
19 | for (String name : m_rootDir.list()) {
20 | if (name.startsWith("cat-")) {
21 | checkProject(name);
22 | }
23 | }
24 | }
25 |
26 | private void checkProject(String name) throws Exception {
27 | UpgradeMojo mojo = new UpgradeMojo();
28 | MavenProject project = new MavenProject();
29 | File baseDir = new File(m_rootDir, name);
30 |
31 | project.setName(baseDir.getName());
32 | project.getCompileSourceRoots().add(new File(baseDir, "src/main/java").getCanonicalPath());
33 | project.getTestCompileSourceRoots().add(new File(baseDir, "src/test/java").getCanonicalPath());
34 |
35 | Reflects.forField().setDeclaredFieldValue(UpgradeMojo.class, "m_project", mojo, project);
36 |
37 | mojo.execute();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/main/resources/META-INF/wizard/webapp/xsl/web-inf/app-tld.xsl:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | Application specific JSP tag library
16 | app
17 | 1.2
18 | a
19 |
20 | layout
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/model-sample.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 1m
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/jdbc/pom-before.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dianping.test
5 | parent
6 | 0.1.0
7 |
8 | 4.0.0
9 | test-server
10 | Test Server
11 |
12 |
13 | mysql
14 | mysql-connector-java
15 |
16 |
17 | org.springframework
18 | spring-context
19 |
20 |
21 | log4j
22 | log4j
23 |
24 |
25 | commons-lang
26 | commons-lang
27 |
28 |
29 | junit
30 | junit
31 | test
32 |
33 |
34 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/resources/org/unidal/maven/plugin/wizard/catconfig/pom-before.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | com.dianping.test
5 | parent
6 | 0.1.0
7 |
8 | 4.0.0
9 | test-server
10 | Test Server
11 |
12 |
13 | mysql
14 | mysql-connector-java
15 |
16 |
17 | org.springframework
18 | spring-context
19 |
20 |
21 | log4j
22 | log4j
23 |
24 |
25 | commons-lang
26 | commons-lang
27 |
28 |
29 | junit
30 | junit
31 | test
32 |
33 |
34 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/dianping-liger-datasource/model/datasource-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/phoenix-deploy/model/deploy-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/dobby-model/model/model-codegen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/framework/DefaultFileStorage.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 |
6 | import org.unidal.codegen.model.entity.OutputModel;
7 | import org.unidal.helper.Files;
8 | import org.unidal.lookup.annotation.Named;
9 |
10 | @Named(type = FileStorage.class)
11 | public class DefaultFileStorage implements FileStorage {
12 | @Override
13 | public void copyResources(GenerationContext ctx, OutputModel output) throws IOException {
14 | // System.out.println(output.getTemplate() + "=>" + output.getPath());
15 | }
16 |
17 | @Override
18 | public void writeFile(GenerationContext ctx, OutputModel output, String content) throws IOException {
19 | FileMode mode = FileMode.getByName(output.getMode());
20 | File target = ctx.getFile(output.getPath());
21 |
22 | switch (mode) {
23 | case CREATE_IF_NOT_EXISTS:
24 | if (target.exists()) {
25 | break;
26 | }
27 | case CREATE_OR_OVERWRITE:
28 | target.getParentFile().mkdirs();
29 |
30 | Files.forIO().writeTo(target, content);
31 |
32 | ctx.verbose(String.format("File %s generated.", target));
33 | ctx.getGeneratedFiles().incrementAndGet();
34 | break;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/model-array/model/model.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/main/java/org/unidal/maven/plugin/source/lines/Constants.java:
--------------------------------------------------------------------------------
1 | /* THIS FILE WAS AUTO GENERATED BY codegen-maven-plugin, DO NOT EDIT IT */
2 | package org.unidal.maven.plugin.source.lines;
3 |
4 | public class Constants {
5 |
6 | public static final String ATTR_CLASS = "class";
7 |
8 | public static final String ATTR_COMMENT = "comment";
9 |
10 | public static final String ATTR_EMPTY = "empty";
11 |
12 | public static final String ATTR_FILES = "files";
13 |
14 | public static final String ATTR_GENERATED = "generated";
15 |
16 | public static final String ATTR_GENERATED_FILES = "generated-files";
17 |
18 | public static final String ATTR_LINES = "lines";
19 |
20 | public static final String ATTR_NAME = "name";
21 |
22 | public static final String ATTR_PACKAGE = "package";
23 |
24 | public static final String ATTR_TEST = "test";
25 |
26 | public static final String ATTR_TEST_FILES = "test-files";
27 |
28 | public static final String ENTITY_CLASS = "class";
29 |
30 | public static final String ENTITY_COUNT = "count";
31 |
32 | public static final String ENTITY_PROJECT = "project";
33 |
34 | public static final String ENTITY_ROOT = "root";
35 |
36 | public static final String ENTITY_CLASSES = "classes";
37 |
38 | public static final String ENTITY_PROJECTS = "projects";
39 | }
40 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/starter-metadata/model/metadata-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/codegen-foundation/src/test/java/org/unidal/codegen/framework/XmlAggregatorTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework;
2 |
3 | import java.io.File;
4 | import java.io.InputStream;
5 | import java.net.URL;
6 |
7 | import org.junit.Assert;
8 | import org.junit.Test;
9 | import org.unidal.codegen.model.CodegenModelHelper;
10 | import org.unidal.codegen.model.entity.Any;
11 | import org.unidal.codegen.model.entity.StructureModel;
12 | import org.unidal.codegen.model.entity.ManifestModel;
13 | import org.unidal.lookup.ComponentTestCase;
14 |
15 | public class XmlAggregatorTest extends ComponentTestCase {
16 | @Test
17 | public void test() throws Exception {
18 | URL url = getClass().getResource("meta-manifest.xml");
19 | InputStream sin = getClass().getResourceAsStream("structure.xml");
20 | InputStream in = getClass().getResourceAsStream("meta.xml");
21 |
22 | StructureModel structure = CodegenModelHelper.fromXml(StructureModel.class, sin);
23 | ManifestModel manifest = CodegenModelHelper.fromXml(ManifestModel.class, url.openStream());
24 | XmlAggregator aggregator = lookup(XmlAggregator.class);
25 |
26 | Any result = aggregator.aggregate(new File(url.getPath()), structure, manifest);
27 | Any expected = CodegenModelHelper.fromXml(Any.class, in);
28 |
29 | Assert.assertEquals(expected.toString(), result.toString());
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-model/cat-bug/model/bug-model.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/source-code-maven-plugin/src/main/java/org/unidal/maven/plugin/source/pipeline/AbstractSourceHandlerContext.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.source.pipeline;
2 |
3 | public class AbstractSourceHandlerContext extends SourceHandlerAdaptor implements SourceHandlerContext {
4 | private SourcePipeline m_pipeline;
5 |
6 | private Source m_source;
7 |
8 | AbstractSourceHandlerContext m_prev;
9 |
10 | AbstractSourceHandlerContext m_next;
11 |
12 | public AbstractSourceHandlerContext(SourcePipeline pipeline, Source source) {
13 | m_pipeline = pipeline;
14 | m_source = source;
15 | }
16 |
17 | @Override
18 | public void fireEnd(SourceScope scope) {
19 | if (m_next != null) {
20 | m_next.handler().handleEnd(m_next, scope);
21 | }
22 | }
23 |
24 | @Override
25 | public void fireLine(String line) {
26 | if (m_next != null) {
27 | m_next.handler().handleLine(m_next, line);
28 | }
29 | }
30 |
31 | @Override
32 | public void fireStart(SourceScope scope) {
33 | if (m_next != null) {
34 | m_next.handler().handleStart(m_next, scope);
35 | }
36 | }
37 |
38 | @Override
39 | public SourceHandler handler() {
40 | throw new UnsupportedOperationException("This should NOT happen!");
41 | }
42 |
43 | @Override
44 | public SourcePipeline pipeline() {
45 | return m_pipeline;
46 | }
47 |
48 | @Override
49 | public Source source() {
50 | return m_source;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/framework/build/ComponentsConfigurator.java:
--------------------------------------------------------------------------------
1 | package org.unidal.codegen.framework.build;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import org.unidal.codegen.code.DefaultObfuscater;
7 | import org.unidal.codegen.framework.DefaultFileStorage;
8 | import org.unidal.codegen.framework.DefaultXslGenerator;
9 | import org.unidal.codegen.framework.DefaultXmlAggregator;
10 | import org.unidal.codegen.framework.DefaultXslTransformer;
11 | import org.unidal.lookup.configuration.AbstractResourceConfigurator;
12 | import org.unidal.lookup.configuration.Component;
13 |
14 | class ComponentsConfigurator extends AbstractResourceConfigurator {
15 | public static void main(String[] args) {
16 | generatePlexusComponentsXmlFile(new ComponentsConfigurator());
17 | }
18 |
19 | @Override
20 | public List defineComponents() {
21 | List all = new ArrayList();
22 |
23 | all.add(A(DefaultXslGenerator.class));
24 | all.add(A(DefaultXmlAggregator.class));
25 | all.add(A(DefaultXslTransformer.class));
26 | all.add(A(DefaultFileStorage.class));
27 |
28 | all.add(A(DefaultObfuscater.class));
29 |
30 | return all;
31 | }
32 |
33 | @Override
34 | protected boolean isMavenPlugin() {
35 | return true;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/wizard-maven-plugin/src/test/java/org/unidal/maven/plugin/wizard/WebAppMojoTest.java:
--------------------------------------------------------------------------------
1 | package org.unidal.maven.plugin.wizard;
2 |
3 | import java.io.File;
4 |
5 | import org.junit.Assert;
6 | import org.junit.Test;
7 | import org.unidal.codegen.framework.XslGenerator;
8 | import org.unidal.maven.plugin.wizard.meta.WebAppWizardBuilder;
9 | import org.unidal.maven.plugin.wizard.pom.WebAppPomBuilder;
10 |
11 | public class WebAppMojoTest extends AbstractWizardMojoTest {
12 | @Test
13 | public void testMojo() throws Exception {
14 | WizardMojoSupport mojo = WizardMojoBuilder.builder(this, WebAppMojo.class) //
15 | .pom("webapp-pom.xml") //
16 | .component("m_wizardBuilder", WebAppWizardBuilder.class) //
17 | .component("m_pomBuilder", WebAppPomBuilder.class) //
18 | .component("m_generator", XslGenerator.class) //
19 | .build();
20 | File baseDir = mojo.getProject().getBasedir();
21 |
22 | System.setProperty("project.package", "org.unidal.webapp");
23 | System.setProperty("web.module", "true");
24 | System.setProperty("web.name", "cat");
25 | System.setProperty("web.template", "thymeleaf");
26 | System.setProperty("web.module", "ui");
27 | System.setProperty("web.page", "home");
28 |
29 | mojo.execute();
30 |
31 | Assert.assertEquals(true, new File(baseDir, "pom.xml").exists());
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/codegen-maven-plugin/src/test/dal-jdbc/sources/org/unidal/dal/jdbc/QueryDef.java:
--------------------------------------------------------------------------------
1 | package org.unidal.dal.jdbc;
2 |
3 | public class QueryDef {
4 | private String m_name;
5 |
6 | private Class> m_entityClass;
7 |
8 | private String m_pattern;
9 |
10 | private QueryType m_type;
11 |
12 | private boolean m_storeProcedure;
13 |
14 | private boolean m_raw;
15 |
16 | public QueryDef(String name, Class> entityClass, QueryType type, String pattern) {
17 | m_name = name;
18 | m_entityClass = entityClass;
19 | m_type = type;
20 | m_pattern = pattern;
21 | m_raw = false;
22 | }
23 |
24 | public QueryDef(String name, Class> entityClass, QueryType type, String pattern, boolean isStoreProcedure) {
25 | this(name, entityClass, type, pattern);
26 |
27 | m_storeProcedure = isStoreProcedure;
28 | }
29 |
30 | public Class> getEntityClass() {
31 | return m_entityClass;
32 | }
33 |
34 | public String getName() {
35 | return m_name;
36 | }
37 |
38 | public QueryType getType() {
39 | return m_type;
40 | }
41 |
42 | public boolean isRaw() {
43 | return m_raw;
44 | }
45 |
46 | public boolean isStoreProcedure() {
47 | return m_storeProcedure;
48 | }
49 |
50 | @Override
51 | public String toString() {
52 | return m_pattern;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/codegen-foundation/src/main/java/org/unidal/codegen/model/entity/StructureModel.java:
--------------------------------------------------------------------------------
1 | /* THIS FILE WAS AUTO GENERATED BY codegen-maven-plugin, DO NOT EDIT IT */
2 | package org.unidal.codegen.model.entity;
3 |
4 | import org.unidal.codegen.model.BaseEntity;
5 | import org.unidal.codegen.model.IVisitor;
6 |
7 | public class StructureModel extends BaseEntity {
8 | private NodeModel m_node;
9 |
10 | public StructureModel() {
11 | }
12 |
13 | @Override
14 | public void accept(IVisitor visitor) {
15 | visitor.visitStructure(this);
16 | }
17 |
18 | @Override
19 | public boolean equals(Object obj) {
20 | if (obj instanceof StructureModel) {
21 | StructureModel _o = (StructureModel) obj;
22 |
23 | if (!equals(getNode(), _o.getNode())) {
24 | return false;
25 | }
26 |
27 |
28 | return true;
29 | }
30 |
31 | return false;
32 | }
33 |
34 | public NodeModel getNode() {
35 | return m_node;
36 | }
37 |
38 | @Override
39 | public int hashCode() {
40 | int hash = 0;
41 |
42 | hash = hash * 31 + (m_node == null ? 0 : m_node.hashCode());
43 |
44 | return hash;
45 | }
46 |
47 | @Override
48 | public void mergeAttributes(StructureModel other) {
49 | }
50 |
51 | public StructureModel setNode(NodeModel node) {
52 | m_node = node;
53 | return this;
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------