Skip to content

Commit

Permalink
Merge pull request #57 from tvd12/master
Browse files Browse the repository at this point in the history
release version 1.2.7
  • Loading branch information
tvd12 authored Mar 24, 2017
2 parents c2e36e3 + 326d457 commit 72ca24e
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.tvd12</groupId>
<artifactId>ezyfox-core</artifactId>
<version>1.2.6-SNAPSHOT</version>
<version>1.2.7-SNAPSHOT</version>
<packaging>jar</packaging>

<name>ezyfox-core</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
*/
public interface APIEvent {

static final String ZONE_JOIN = "zoneJoin";
static final String ZONE_JOIN = "zj";

}
15 changes: 15 additions & 0 deletions src/main/java/com/tvd12/ezyfox/core/entities/ApiLoggable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.tvd12.ezyfox.core.entities;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ApiLoggable {

private Logger logger =
LoggerFactory.getLogger(getClass());

protected Logger getLogger() {
return logger;
}

}
11 changes: 11 additions & 0 deletions src/main/java/com/tvd12/ezyfox/core/entities/ApiModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ public <T> T getProperty(Object key) {
return (T) properties.get(key);
}

/**
* get the value to which the specified key is mapped
*
* @param <T> type of value
* @param key key
* @return a value
*/
public <T> T get(Class<T> key) {
return getProperty(key);
}

/**
* get the value to which the specified key is mapped and cast value to specific type
* @see java.util.Map#get(Object)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.tvd12.ezyfox.core.testing.entities;

import org.testng.annotations.Test;

import com.tvd12.ezyfox.core.entities.ApiLoggable;
import com.tvd12.test.base.BaseTest;
import com.tvd12.test.reflect.MethodInvoker;

public class ApiLoggableTest extends BaseTest {

@Test
public void test() {
ApiLoggable loggable = new ApiLoggable();
MethodInvoker.create()
.method("getLogger")
.object(loggable)
.invoke();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public void test() {
assertTrue(b3.equals(b3));
assertEquals(b3.hashCode(), b4.hashCode());

user2.setProperty(ApiUserTest.class, this);
assertEquals(user2.get(getClass()), this);

}


Expand Down

0 comments on commit 72ca24e

Please sign in to comment.