WIP
Work
This commit is contained in:
parent
87390f9dd1
commit
e4b31838f4
12 changed files with 149 additions and 136 deletions
|
|
@ -29,12 +29,16 @@
|
||||||
<artifactId>assertj-core</artifactId>
|
<artifactId>assertj-core</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
<version>${kotlin.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<!--plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>2.10.4</version>
|
<version>2.10.4</version>
|
||||||
|
|
@ -49,6 +53,39 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<detectJavaApiLink>false</detectJavaApiLink>
|
<detectJavaApiLink>false</detectJavaApiLink>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
</plugin-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
|
<version>${kotlin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>compile</id>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal> <!-- You can skip the <goals> element
|
||||||
|
if you enable extensions for the plugin -->
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceDirs>
|
||||||
|
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
|
||||||
|
<sourceDir>${project.basedir}/src/main/java</sourceDir>
|
||||||
|
</sourceDirs>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>test-compile</id>
|
||||||
|
<goals>
|
||||||
|
<goal>test-compile</goal> <!-- You can skip the <goals> element
|
||||||
|
if you enable extensions for the plugin -->
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceDirs>
|
||||||
|
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
|
||||||
|
<sourceDir>${project.basedir}/src/test/java</sourceDir>
|
||||||
|
</sourceDirs>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
@ -58,6 +95,30 @@
|
||||||
<source>${pymma.java.version}</source>
|
<source>${pymma.java.version}</source>
|
||||||
<target>${pymma.java.version}</target>
|
<target>${pymma.java.version}</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>default-compile</id>
|
||||||
|
<phase>none</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>default-testCompile</id>
|
||||||
|
<phase>none</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>java-compile</id>
|
||||||
|
<phase>compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>java-test-compile</id>
|
||||||
|
<phase>test-compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>testCompile</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
package org.chtijbug.drools.common;
|
|
||||||
|
|
||||||
public class KafkaTopicConstants {
|
|
||||||
public final static String LOGING_TOPIC ="logging";
|
|
||||||
public final static String RESPONSE_DEPLOY_TOPIC ="ResponseDeploy";
|
|
||||||
public final static String REVERSE_PROXY="proxy";
|
|
||||||
}
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2014 Pymma Software
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package org.chtijbug.drools.common.date;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by IntelliJ IDEA.
|
|
||||||
* Date: 04/06/13
|
|
||||||
* Time: 16:38
|
|
||||||
* To change this template use File | Settings | File Templates.
|
|
||||||
*/
|
|
||||||
public class DateHelper {
|
|
||||||
public static String sFormat = "yyyy-MM-dd";
|
|
||||||
|
|
||||||
public static Date getDate(String sDate) throws Exception {
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat(sFormat);
|
|
||||||
return sdf.parse(sDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Date getDate(String sDate, String anotherFormat)
|
|
||||||
throws Exception {
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat(anotherFormat);
|
|
||||||
return sdf.parse(sDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getDate(Date date) {
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat(sFormat);
|
|
||||||
String formatedDate = sdf.format(date);
|
|
||||||
return formatedDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getDate(Date date, String anotherFormat) {
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat(anotherFormat);
|
|
||||||
String formatedDate = sdf.format(date);
|
|
||||||
return formatedDate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
package org.chtijbug.drools.common.rest;
|
|
||||||
|
|
||||||
public class Constants {
|
|
||||||
public final static String AUTHORISATION_HEADER = "Authorization";
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
package org.chtijbug.drools.common.rest;
|
|
||||||
|
|
||||||
public class InputElement {
|
|
||||||
|
|
||||||
|
|
||||||
private String jsonInput;
|
|
||||||
private String className;
|
|
||||||
|
|
||||||
|
|
||||||
public String getJsonInput() {
|
|
||||||
return jsonInput;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setJsonInput(String jsonInput) {
|
|
||||||
this.jsonInput = jsonInput;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getClassName() {
|
|
||||||
return className;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setClassName(String className) {
|
|
||||||
this.className = className;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
package org.chtijbug.drools.common.rest;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class MultipleInputs {
|
|
||||||
|
|
||||||
private List<InputElement> inputElementList;
|
|
||||||
|
|
||||||
public List<InputElement> getInputElementList() {
|
|
||||||
return inputElementList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInputElementList(List<InputElement> inputElementList) {
|
|
||||||
this.inputElementList = inputElementList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package org.chtijbug.drools.common.date
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
class DateHelper {
|
||||||
|
companion object {
|
||||||
|
var sFormat: String = "yyyy-MM-dd"
|
||||||
|
fun getDate(sDate: String?): Date {
|
||||||
|
val sdf = SimpleDateFormat(sFormat)
|
||||||
|
return sdf.parse(sDate)
|
||||||
|
}
|
||||||
|
fun getDate(sDate: String?, anotherFormat: String): Date {
|
||||||
|
val sdf = SimpleDateFormat(anotherFormat)
|
||||||
|
return sdf.parse(sDate)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getDate(date: Date?): String {
|
||||||
|
val sdf = SimpleDateFormat(sFormat)
|
||||||
|
val formatedDate = sdf.format(date)
|
||||||
|
return formatedDate
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getDate(date: Date?, anotherFormat: String): String {
|
||||||
|
val sdf = SimpleDateFormat(anotherFormat)
|
||||||
|
val formatedDate = sdf.format(date)
|
||||||
|
return formatedDate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -18,22 +18,6 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>2.10.4</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<detectJavaApiLink>false</detectJavaApiLink>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
<modules>
|
<modules>
|
||||||
<!--module>drools-framework-loyalty-model</module-->
|
<!--module>drools-framework-loyalty-model</module-->
|
||||||
<module>drools-framework-swimming-pool-model</module>
|
<module>drools-framework-swimming-pool-model</module>
|
||||||
<module>drools-framework-swimmingpool-web-ui</module>
|
<!--module>drools-framework-swimmingpool-web-ui</module-->
|
||||||
<!--module>drools-framework-loyalty-web</module-->
|
<!--module>drools-framework-loyalty-web</module-->
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,19 +12,37 @@
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
|
<version>${kotlin.version}</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-javadocs</id>
|
<id>compile</id>
|
||||||
<goals>
|
<goals>
|
||||||
<goal>jar</goal>
|
<goal>compile</goal> <!-- You can skip the <goals> element
|
||||||
|
if you enable extensions for the plugin -->
|
||||||
</goals>
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceDirs>
|
||||||
|
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
|
||||||
|
<sourceDir>${project.basedir}/src/main/java</sourceDir>
|
||||||
|
</sourceDirs>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>test-compile</id>
|
||||||
|
<goals>
|
||||||
|
<goal>test-compile</goal> <!-- You can skip the <goals> element
|
||||||
|
if you enable extensions for the plugin -->
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sourceDirs>
|
||||||
|
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
|
||||||
|
<sourceDir>${project.basedir}/src/test/java</sourceDir>
|
||||||
|
</sourceDirs>
|
||||||
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
|
||||||
<detectJavaApiLink>false</detectJavaApiLink>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
@ -34,6 +52,30 @@
|
||||||
<source>${pymma.java.version}</source>
|
<source>${pymma.java.version}</source>
|
||||||
<target>${pymma.java.version}</target>
|
<target>${pymma.java.version}</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>default-compile</id>
|
||||||
|
<phase>none</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>default-testCompile</id>
|
||||||
|
<phase>none</phase>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>java-compile</id>
|
||||||
|
<phase>compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>compile</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>java-test-compile</id>
|
||||||
|
<phase>test-compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>testCompile</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@ package org.chtijbug.drools.runtime;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
import org.chtijbug.drools.common.date.DateHelper;
|
|
||||||
import org.chtijbug.drools.entity.DroolsFactObject;
|
import org.chtijbug.drools.entity.DroolsFactObject;
|
||||||
import org.chtijbug.drools.runtime.pojotest.User;
|
import org.chtijbug.drools.runtime.pojotest.User;
|
||||||
import org.chtijbug.drools.runtime.pojotest.UserName;
|
import org.chtijbug.drools.runtime.pojotest.UserName;
|
||||||
|
import org.chtijbug.drools.common.date.DateHelper;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
@ -43,7 +43,7 @@ public class JSONdroolsObjecttest {
|
||||||
User user = new User();
|
User user = new User();
|
||||||
user.setUserId("1");
|
user.setUserId("1");
|
||||||
user.setUserName(userName);
|
user.setUserName(userName);
|
||||||
user.setDob(DateHelper.getDate("2013-12-31"));
|
user.setDob(DateHelper.Companion.getDate("2013-12-31"));
|
||||||
DroolsFactObject droolsFactObject = new DroolsFactObject(user, 1);
|
DroolsFactObject droolsFactObject = new DroolsFactObject(user, 1);
|
||||||
InputStream stream = JSONdroolsObjecttest.class.getResourceAsStream("/user.json");
|
InputStream stream = JSONdroolsObjecttest.class.getResourceAsStream("/user.json");
|
||||||
String toto = IOUtils.toString(stream, "utf-8");
|
String toto = IOUtils.toString(stream, "utf-8");
|
||||||
|
|
|
||||||
5
pom.xml
5
pom.xml
|
|
@ -41,6 +41,7 @@
|
||||||
<postgres.version>42.2.8</postgres.version>
|
<postgres.version>42.2.8</postgres.version>
|
||||||
<postgresql.version>42.2.8</postgresql.version>
|
<postgresql.version>42.2.8</postgresql.version>
|
||||||
<activemq.version>5.15.10</activemq.version>
|
<activemq.version>5.15.10</activemq.version>
|
||||||
|
<kotlin.version>1.9.25</kotlin.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,7 +112,7 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<!--plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>2.10.4</version>
|
<version>2.10.4</version>
|
||||||
|
|
@ -127,7 +128,7 @@
|
||||||
<additionalparam>-Xdoclint:none</additionalparam>
|
<additionalparam>-Xdoclint:none</additionalparam>
|
||||||
<detectJavaApiLink>false</detectJavaApiLink>
|
<detectJavaApiLink>false</detectJavaApiLink>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin-->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue