-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from wu-sheng/feature/3.0.1
Prepare for release 3.0.1
- Loading branch information
Showing
284 changed files
with
4,948 additions
and
3,019 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...alking-collector-cluster/src/main/java/com/a/eye/skywalking/collector/log/LogManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.a.eye.skywalking.collector.log; | ||
|
||
import org.apache.logging.log4j.Logger; | ||
|
||
/** | ||
* @author pengys5 | ||
*/ | ||
public enum LogManager { | ||
INSTANCE; | ||
|
||
public Logger getFormatterLogger(final Class<?> clazz) { | ||
return org.apache.logging.log4j.LogManager.getFormatterLogger(clazz); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...test/java/com/a/eye/skywalking/collector/actor/AbstractClusterWorkerProviderTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package com.a.eye.skywalking.collector.actor; | ||
|
||
import akka.actor.ActorSystem; | ||
import com.a.eye.skywalking.collector.actor.selector.RollingSelector; | ||
import com.a.eye.skywalking.collector.actor.selector.WorkerSelector; | ||
import com.a.eye.skywalking.collector.log.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.mockito.Mockito; | ||
import org.powermock.reflect.Whitebox; | ||
|
||
/** | ||
* @author pengys5 | ||
*/ | ||
//@RunWith(PowerMockRunner.class) | ||
//@PrepareForTest({LogManager.class}) | ||
public class AbstractClusterWorkerProviderTestCase { | ||
|
||
// @Test | ||
public void testOnCreate() throws ProviderNotFoundException { | ||
LogManager logManager = Mockito.mock(LogManager.class); | ||
Whitebox.setInternalState(LogManager.class, "INSTANCE", logManager); | ||
Logger logger = Mockito.mock(Logger.class); | ||
Mockito.when(logManager.getFormatterLogger(Mockito.any())).thenReturn(logger); | ||
|
||
ActorSystem actorSystem = Mockito.mock(ActorSystem.class); | ||
ClusterWorkerContext clusterWorkerContext = new ClusterWorkerContext(actorSystem); | ||
Impl impl = new Impl(); | ||
impl.onCreate(null); | ||
} | ||
|
||
class Impl extends AbstractClusterWorkerProvider<AbstractClusterWorkerTestCase.Impl> { | ||
@Override public Role role() { | ||
return Role.INSTANCE; | ||
} | ||
|
||
@Override public AbstractClusterWorkerTestCase.Impl workerInstance(ClusterWorkerContext clusterContext) { | ||
return new AbstractClusterWorkerTestCase.Impl(role(), clusterContext, new LocalWorkerContext()); | ||
} | ||
|
||
@Override public int workerNum() { | ||
return 0; | ||
} | ||
} | ||
|
||
enum Role implements com.a.eye.skywalking.collector.actor.Role { | ||
INSTANCE; | ||
|
||
@Override | ||
public String roleName() { | ||
return AbstractClusterWorkerTestCase.Impl.class.getSimpleName(); | ||
} | ||
|
||
@Override | ||
public WorkerSelector workerSelector() { | ||
return new RollingSelector(); | ||
} | ||
} | ||
} |
Oops, something went wrong.