refactoring and adding camel business proxy
This commit is contained in:
parent
f42ed3c71d
commit
a474dcf891
876 changed files with 1692 additions and 1038 deletions
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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.runtime;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static junit.framework.Assert.assertNotNull;
|
||||
|
||||
public class DroolsChtijbugExceptionTest {
|
||||
@Test
|
||||
public void should_keep_root_cause() {
|
||||
IllegalArgumentException rootCause = new IllegalArgumentException();
|
||||
|
||||
DroolsChtijbugException chtijbugException = new DroolsChtijbugException("key", "bla", rootCause);
|
||||
|
||||
assertNotNull(chtijbugException.getCause());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* 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.runtime;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.chtijbug.drools.common.date.DateHelper;
|
||||
import org.chtijbug.drools.entity.DroolsFactObject;
|
||||
import org.chtijbug.drools.runtime.pojotest.User;
|
||||
import org.chtijbug.drools.runtime.pojotest.UserName;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* Date: 24/02/14
|
||||
* Time: 16:25
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class JSONdroolsObjecttest {
|
||||
@Test
|
||||
public void testJson() throws Exception {
|
||||
|
||||
UserName userName = new UserName();
|
||||
userName.setFirstname("Katamreddy");
|
||||
userName.setMiddlename("Siva");
|
||||
userName.setLastname("PrasadReddy");
|
||||
|
||||
User user = new User();
|
||||
user.setUserId("1");
|
||||
user.setUserName(userName);
|
||||
user.setDob(DateHelper.getDate("2013-12-31"));
|
||||
DroolsFactObject droolsFactObject = new DroolsFactObject(user, 1);
|
||||
InputStream stream = JSONdroolsObjecttest.class.getResourceAsStream("/user.json");
|
||||
String toto = IOUtils.toString(stream, "utf-8");
|
||||
Assert.assertTrue(toto.equals(droolsFactObject.getRealObject_JSON()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* 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.runtime.pojotest;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class User {
|
||||
private String userId;
|
||||
private UserName userName;
|
||||
private Date dob;
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public UserName getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(UserName userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public Date getDob() {
|
||||
return dob;
|
||||
}
|
||||
|
||||
public void setDob(Date dob) {
|
||||
this.dob = dob;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User [dob=" + dob + ", userId=" + userId + ", userName=" + userName + "]";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* 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.runtime.pojotest;
|
||||
|
||||
public class UserName {
|
||||
private String firstname;
|
||||
private String middlename;
|
||||
private String lastname;
|
||||
|
||||
public UserName() {
|
||||
}
|
||||
|
||||
public String getFirstname() {
|
||||
return firstname;
|
||||
}
|
||||
|
||||
public void setFirstname(String firstname) {
|
||||
this.firstname = firstname;
|
||||
}
|
||||
|
||||
public String getMiddlename() {
|
||||
return middlename;
|
||||
}
|
||||
|
||||
public void setMiddlename(String middlename) {
|
||||
this.middlename = middlename;
|
||||
}
|
||||
|
||||
public String getLastname() {
|
||||
return lastname;
|
||||
}
|
||||
|
||||
public void setLastname(String lastname) {
|
||||
this.lastname = lastname;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserName [firstname=" + firstname +
|
||||
", lastname=" + lastname +
|
||||
", middlename=" + middlename + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{"userId":"1","userName":{"firstname":"Katamreddy","middlename":"Siva","lastname":"PrasadReddy"},"dob":1388444400000}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue