Skip to content

Commit b1207fc

Browse files
committed
Minor changes
1 parent f9dc93c commit b1207fc

File tree

7 files changed

+47
-76
lines changed

7 files changed

+47
-76
lines changed

pom.xml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
<groupId>com.github.stefanbirkner</groupId>
125125
<artifactId>system-rules</artifactId>
126126
<version>1.16.0</version>
127-
<!--<scope>test</scope>-->
128127
</dependency>
129128

130129

@@ -154,35 +153,6 @@
154153
</activation>
155154
<build>
156155
<plugins>
157-
<!--<plugin>-->
158-
<!--<artifactId>maven-deploy-plugin</artifactId>-->
159-
<!--<version>2.8.1</version>-->
160-
<!--<configuration>-->
161-
<!--<altDeploymentRepository>internal.repo::default::file://${project.build.directory}/mvn-repo</altDeploymentRepository>-->
162-
<!--</configuration>-->
163-
<!--</plugin>-->
164-
<!--<plugin>-->
165-
<!--<groupId>com.github.github</groupId>-->
166-
<!--<artifactId>site-maven-plugin</artifactId>-->
167-
<!--<version>0.11</version>-->
168-
<!--<configuration>-->
169-
<!--<message>Maven artifacts for ${project.version}</message>-->
170-
<!--<noJekyll>true</noJekyll>-->
171-
<!--<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>-->
172-
<!--<branch>refs/heads/mvn-repo</branch>-->
173-
<!--<includes><include>**/*</include></includes>-->
174-
<!--<repositoryName>java-sdk</repositoryName>-->
175-
<!--<repositoryOwner>hobbit-project</repositoryOwner>-->
176-
<!--</configuration>-->
177-
<!--<executions>-->
178-
<!--<execution>-->
179-
<!--<goals>-->
180-
<!--<goal>site</goal>-->
181-
<!--</goals>-->
182-
<!--<phase>deploy</phase>-->
183-
<!--</execution>-->
184-
<!--</executions>-->
185-
<!--</plugin>-->
186156
<plugin>
187157
<groupId>org.apache.maven.plugins</groupId>
188158
<artifactId>maven-compiler-plugin</artifactId>
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
package org.hobbit.sdk;
2-
3-
import org.junit.contrib.java.lang.system.EnvironmentVariables;
4-
//import org.junit.Rule;
5-
6-
7-
/**
8-
* @author Roman Katerinenko
9-
*/
10-
public class EnvironmentVariablesWrapper {
11-
12-
public final EnvironmentVariables environmentVariables = new EnvironmentVariables();
13-
14-
15-
// public void setupCommunicationEnvironmentVariables(String rabbitHostName, String sesstionId) {
16-
// environmentVariables.set(Constants.RABBIT_MQ_HOST_NAME_KEY, rabbitHostName);
17-
// environmentVariables.set(Constants.HOBBIT_SESSION_ID_KEY, sesstionId);
18-
// }
1+
//package org.hobbit.sdk;
192
//
20-
// public void setupBenchmarkEnvironmentVariables(String experimentUri, String benchmarkParameters){
21-
// environmentVariables.set(Constants.HOBBIT_EXPERIMENT_URI_KEY, experimentUri);
22-
// //environmentVariables.set(Constants.BENCHMARK_PARAMETERS_MODEL_KEY, benchmarkParameters.encodeToString());
23-
// }
3+
//import org.junit.contrib.java.lang.system.EnvironmentVariables;
4+
////import org.junit.Rule;
245
//
25-
// public void setupGeneratorEnvironmentVariables(int generatorId, int generatorCount) {
26-
// environmentVariables.set(Constants.GENERATOR_ID_KEY, String.valueOf(generatorId));
27-
// environmentVariables.set(Constants.GENERATOR_COUNT_KEY, String.valueOf(generatorCount));
28-
// }
296
//
30-
// public void setupSystemEnvironmentVariables(String systemUri, String systemParameters) {
31-
// //environmentVariables.set(Constants.SYSTEM_PARAMETERS_MODEL_KEY, systemParameters.encodeToString());
32-
// environmentVariables.set(Constants.SYSTEM_URI_KEY, systemUri);
33-
// }
34-
35-
}
7+
///**
8+
// * @author Roman Katerinenko
9+
// */
10+
//public class EnvironmentVariablesWrapper {
11+
//
12+
// public final EnvironmentVariables environmentVariables = new EnvironmentVariables();
13+
//
14+
//
15+
//// public void setupCommunicationEnvironmentVariables(String rabbitHostName, String sesstionId) {
16+
//// environmentVariables.set(Constants.RABBIT_MQ_HOST_NAME_KEY, rabbitHostName);
17+
//// environmentVariables.set(Constants.HOBBIT_SESSION_ID_KEY, sesstionId);
18+
//// }
19+
////
20+
//// public void setupBenchmarkEnvironmentVariables(String experimentUri, String benchmarkParameters){
21+
//// environmentVariables.set(Constants.HOBBIT_EXPERIMENT_URI_KEY, experimentUri);
22+
//// //environmentVariables.set(Constants.BENCHMARK_PARAMETERS_MODEL_KEY, benchmarkParameters.encodeToString());
23+
//// }
24+
////
25+
//// public void setupGeneratorEnvironmentVariables(int generatorId, int generatorCount) {
26+
//// environmentVariables.set(Constants.GENERATOR_ID_KEY, String.valueOf(generatorId));
27+
//// environmentVariables.set(Constants.GENERATOR_COUNT_KEY, String.valueOf(generatorCount));
28+
//// }
29+
////
30+
//// public void setupSystemEnvironmentVariables(String systemUri, String systemParameters) {
31+
//// //environmentVariables.set(Constants.SYSTEM_PARAMETERS_MODEL_KEY, systemParameters.encodeToString());
32+
//// environmentVariables.set(Constants.SYSTEM_URI_KEY, systemUri);
33+
//// }
34+
//
35+
//}

src/main/java/org/hobbit/sdk/utils/commandreactions/ContainerCommandsReaction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ public void handleCmd(Byte command, byte[] bytes, String replyTo) throws Excepti
168168
new CommandSender(containerId.getBytes(), MessageProperties.PERSISTENT_BASIC, replyTo).send();
169169

170170
} catch (Exception e) {
171-
Assert.fail(e.getMessage());
171+
logger.error("Failed to send message: {}", e.getMessage());
172+
e.printStackTrace();
173+
//Assert.fail(e.getMessage());
172174
}
173175
}else{
174176
String test="123";

src/test/java/org/hobbit/sdk/BenchmarkTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
package org.hobbit.sdk;
22

3-
import org.hobbit.sdk.examples.dummybenchmark.test.DummyBenchmarkTestRunner;
43
import org.junit.Before;
54
import org.junit.Ignore;
65
import org.junit.Test;
6+
import org.junit.contrib.java.lang.system.EnvironmentVariables;
77

88
import java.util.Date;
99

1010
import static org.hobbit.sdk.Constants.DUMMY_SYSTEM_IMAGE_NAME;
1111
import static org.hobbit.sdk.Constants.*;
12-
import static org.hobbit.sdk.examples.dummybenchmark.test.DummyBenchmarkTestRunner.createBenchmarkParameters;
12+
import static org.hobbit.sdk.DummyBenchmarkTestRunner.createBenchmarkParameters;
1313

1414
/**
1515
* @author Pavel Smirnov
1616
* This code here is just for testing and debugging SDK.
1717
* For your projects please use code from the https://github.com/hobbit-project/java-sdk-example
1818
*/
1919

20-
public class BenchmarkTest extends EnvironmentVariablesWrapper {
20+
public class BenchmarkTest {
2121

22+
public final EnvironmentVariables environmentVariables = new EnvironmentVariables();
2223
DummyBenchmarkTestRunner sampleSystemTestRunner;
2324

2425
@Before
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
package org.hobbit.sdk.examples.dummybenchmark.test;
1+
package org.hobbit.sdk;
22

3-
import org.apache.commons.io.FileUtils;
43
import org.apache.jena.rdf.model.Model;
54
import org.apache.jena.rdf.model.Resource;
6-
import org.apache.jena.rdf.model.impl.ModelCom;
75
import org.apache.jena.vocabulary.RDF;
86
import org.hobbit.core.Constants;
97
import org.hobbit.core.components.Component;
108
import org.hobbit.core.rabbit.RabbitMQUtils;
119
import org.hobbit.sdk.docker.AbstractDockerizer;
1210
import org.hobbit.sdk.utils.ComponentsExecutor;
13-
import org.hobbit.sdk.EnvironmentVariablesWrapper;
1411
import org.hobbit.sdk.utils.ModelsHandler;
1512
import org.hobbit.sdk.utils.MultiThreadedImageBuilder;
1613
import org.hobbit.sdk.docker.RabbitMqDockerizer;
@@ -20,10 +17,9 @@
2017
import org.hobbit.sdk.utils.commandreactions.CommandReactionsBuilder;
2118
import org.hobbit.vocab.HOBBIT;
2219
import org.junit.Assert;
20+
import org.junit.contrib.java.lang.system.EnvironmentVariables;
2321

24-
import java.io.File;
2522
import java.io.IOException;
26-
import java.util.Date;
2723

2824
import static org.apache.jena.rdf.model.ModelFactory.createDefaultModel;
2925
import static org.hobbit.core.Constants.*;
@@ -35,8 +31,9 @@
3531
* For your projects please use code from the https://github.com/hobbit-project/java-sdk-example
3632
*/
3733

38-
public class DummyBenchmarkTestRunner extends EnvironmentVariablesWrapper {
34+
public class DummyBenchmarkTestRunner {
3935

36+
public final EnvironmentVariables environmentVariables = new EnvironmentVariables();
4037
private AbstractDockerizer rabbitMqDockerizer;
4138
private ComponentsExecutor componentsExecutor;
4239
private CommandQueueListener commandQueueListener;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.hobbit.sdk.examples.dummybenchmark.test;
1+
package org.hobbit.sdk;
22

33
import org.hobbit.core.run.ComponentStarter;
44
import org.hobbit.sdk.docker.builders.DynamicDockerFileBuilder;

src/test/java/org/hobbit/sdk/QueueClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
import org.hobbit.controller.queue.ExperimentQueueImpl;
1010
import org.hobbit.core.Constants;
1111
import org.hobbit.core.rabbit.RabbitMQUtils;
12-
import org.hobbit.sdk.EnvironmentVariablesWrapper;
1312
import org.hobbit.sdk.examples.dummybenchmark.DummyBenchmarkController;
1413
import org.hobbit.sdk.utils.ModelsHandler;
1514
import org.hobbit.vocab.HOBBIT;
15+
import org.junit.contrib.java.lang.system.EnvironmentVariables;
1616
import org.slf4j.Logger;
1717
import org.slf4j.LoggerFactory;
1818

@@ -24,8 +24,9 @@
2424
/**
2525
* @author Pavel Smirnov. ([email protected] / [email protected])
2626
*/
27-
public class QueueClient extends EnvironmentVariablesWrapper {
27+
public class QueueClient {
2828
private static final Logger logger = LoggerFactory.getLogger(QueueClient.class);
29+
public final EnvironmentVariables environmentVariables = new EnvironmentVariables();
2930
ExperimentQueueImpl queue;
3031
String username;
3132

0 commit comments

Comments
 (0)