-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(agents): unit test for mapping and launching agents
- Loading branch information
Showing
7 changed files
with
252 additions
and
41 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
53 changes: 53 additions & 0 deletions
53
...pplication/src/test/java/org/eclipse/mosaic/fed/application/app/TestAgentApplication.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,53 @@ | ||
/* | ||
* Copyright (c) 2025 Fraunhofer FOKUS and others. All rights reserved. | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contact: [email protected] | ||
*/ | ||
|
||
package org.eclipse.mosaic.fed.application.app; | ||
|
||
import org.eclipse.mosaic.fed.application.app.api.Application; | ||
import org.eclipse.mosaic.fed.application.app.api.OperatingSystemAccess; | ||
import org.eclipse.mosaic.fed.application.app.api.os.AgentOperatingSystem; | ||
import org.eclipse.mosaic.lib.util.scheduling.Event; | ||
|
||
import org.mockito.Mockito; | ||
|
||
public class TestAgentApplication extends AbstractApplication<AgentOperatingSystem> | ||
implements TestApplicationWithSpy<OperatingSystemAccess<AgentOperatingSystem>>, Application { | ||
|
||
private final OperatingSystemAccess<AgentOperatingSystem> thisApplicationSpy; | ||
|
||
public TestAgentApplication() { | ||
thisApplicationSpy = Mockito.mock(OperatingSystemAccess.class); | ||
} | ||
|
||
@Override | ||
public OperatingSystemAccess<AgentOperatingSystem> getApplicationSpy() { | ||
return thisApplicationSpy; | ||
} | ||
|
||
@Override | ||
public void onStartup() { | ||
thisApplicationSpy.onStartup(); | ||
} | ||
|
||
@Override | ||
public void onShutdown() { | ||
thisApplicationSpy.onShutdown(); | ||
} | ||
|
||
@Override | ||
public void processEvent(Event event) throws Exception { | ||
thisApplicationSpy.processEvent(event); | ||
} | ||
} |
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
Oops, something went wrong.