use of org.junit.jupiter.api.Disabled in project narchy by automenta.
the class MetricsTest method testSummaryStatistics.
// @Test public void testMeterDerivative() {
//
// TemporalMetrics<Integer> tm = new TemporalMetrics<>(3);
// tm.add(timeDoubler);
// tm.add(new FirstOrderDifference(tm, timeDoubler.signalID(0)));
//
// assertEquals(3, tm.getSignals().size());
//
// tm.update(0.0);
// tm.update(1.0);
//
// //check the '1' column ('x')
// assertEquals(0, tm.getData(1)[0]);
// assertEquals(2, tm.getData(1)[1]);
//
// tm.update(2.0);
//
//
//
// //check the '2' column (first order diff)
// assertEquals(null, tm.getData(2)[0]);
// assertEquals(2.0, tm.getData(2)[1]);
//
//
// }
@Disabled
@Test
public void testSummaryStatistics() {
TemporalMetrics tm = new TemporalMetrics(10);
tm.add(new BasicStatistics(tm, tm.getSignalIDs()[0]));
for (int i = 0; i < 10; i++) {
tm.update(0.1 * i);
}
// noinspection OverlyComplexAnonymousInnerClass
PrintStream sb = new PrintStream(System.out) {
int line;
@Override
public void println(String x) {
String eq = null;
switch(line++) {
case 0:
eq = "\"key\",\"key.mean\",\"key.stdev\"";
break;
case 1:
eq = "0,0,0";
break;
case 3:
eq = "0.2,0.1,0.1";
break;
}
if (eq != null) {
assertEquals(eq, x);
}
}
};
tm.printCSV(sb);
}
use of org.junit.jupiter.api.Disabled in project narchy by automenta.
the class NQuadsRDFTest method testSchema1.
@Disabled
@Test
public void testSchema1() throws Exception {
final NAR n = NARS.tmp();
File output = new File("/tmp/onto.nal");
PrintStream pout = new PrintStream(new BufferedOutputStream(new FileOutputStream(output), 512 * 1024));
n.input(NQuadsRDF.stream(n, new File(// "/tmp/all-layers.nq"
"/home/me/Downloads/nquad")).peek(t -> {
pout.println(t.term().toString() + t.punc());
// t.budget(0, 0.5f);
}));
pout.close();
// n.forEachActiveConcept(c -> {
// c.print();
// });
n.run(1);
// n.focus.active.clear();
n.log();
n.input("$0.9$ (Bacteria <-> Pharmacy)?");
// Param.DEBUG = true;
n.run(128);
// n.index.forEach(c -> {
// System.out.println(c);
// });
}
use of org.junit.jupiter.api.Disabled in project narchy by automenta.
the class NQuadsRDFTest method testSchema2.
@Disabled
@Test
public void testSchema2() throws Exception {
final NAR n = NARS.tmp();
Param.DEBUG = true;
for (String input : new String[] { "/home/me/d/finance/money.orig.n3", "/home/me/d/finance/finance.orig.n3" }) {
File output = new File(input + ".nal");
PrintStream pout = new PrintStream(new BufferedOutputStream(new FileOutputStream(output), 512 * 1024));
NQuadsRDF.stream(n, new File(input)).peek(t -> {
t.pri(n.priDefault(t.punc()) / 10f);
pout.println(t + ".");
}).forEach(x -> {
n.input(x);
// allow process
n.run(1);
});
pout.close();
}
// n.forEachActiveConcept(c -> {
// c.print();
// });
// n.run(512);
/*n.concepts().forEach(Concept::print);
n.concept($.the("Buyer")).print();*/
n.clear();
n.log();
n.run(1);
n.input("({I}-->PhysicalPerson).");
n.run(1);
n.input("({I}-->Seller).");
n.run(1);
n.input("({I}-->ExternalRisk).");
n.run(1);
n.input("({I}-->Service).");
n.run(1);
n.input("({I}-->FinancialInstrument).");
n.run(1);
n.input("({I}-->NonResidentCapitalOwner)!");
n.run(1);
n.input("isReceiverOfPhysicalValue(I,#1)!");
n.run(1);
n.input("--isReceiverOfPhysicalValue(#1,I)!");
n.run(1);
n.input("isReceiverOfObligationValue(I,#1)!");
n.run(1);
n.input("--isReceiverOfObligationValue(#1,I)!");
n.run(1);
n.input("$0.99 (I<->?x)?");
n.run(2512);
}
use of org.junit.jupiter.api.Disabled in project narchy by automenta.
the class JavaDynamicClassLoaderTestCase method LoadClassTest.
@Disabled
@Test
public void LoadClassTest() throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
JavaDynamicClassLoader loader = null;
setPath(true);
URL[] urls = getURLsFromStringArray(paths);
loader = new JavaDynamicClassLoader(urls, this.getClass().getClassLoader());
assertEquals(2, loader.getURLs().length);
Class<?> cl = loader.loadClass("Counter");
assertNotNull(cl);
Method m = cl.getMethod("inc");
m.setAccessible(true);
Object obj = cl.newInstance();
m.invoke(obj);
Method m1 = cl.getMethod("getValue");
m1.setAccessible(true);
Object res_obj = m1.invoke(obj);
int res = new Integer(res_obj.toString());
assertEquals(1, res);
}
use of org.junit.jupiter.api.Disabled in project micrometer by micrometer-metrics.
the class MicrometerMetricsPublisherCommandTest method testOpenCircuit.
@Disabled
@Test
void testOpenCircuit() {
HystrixCommandKey key = HystrixCommandKey.Factory.asKey("MicrometerCOMMAND-B");
HystrixCommandProperties properties = new HystrixPropertiesCommandDefault(key, propertiesSetter.withCircuitBreakerForceOpen(true));
HystrixCommandMetrics metrics = HystrixCommandMetrics.getInstance(key, groupKey, properties);
HystrixCircuitBreaker circuitBreaker = HystrixCircuitBreaker.Factory.getInstance(key, groupKey, properties, metrics);
SimpleMeterRegistry registry = new SimpleMeterRegistry();
MicrometerMetricsPublisherCommand metricsPublisherCommand = new MicrometerMetricsPublisherCommand(registry, key, groupKey, metrics, circuitBreaker, properties);
metricsPublisherCommand.initialize();
new SuccessCommand(key).execute();
new SuccessCommand(key).execute();
new TimeoutCommand(key).execute();
new FailureCommand(key).execute();
new FailureCommand(key).execute();
new SuccessCommand(key).execute();
Iterable<Tag> tags = Tags.of("group", groupKey.name(), "key", key.name());
assertExecutionMetric(registry, "short_circuited", 6.0);
assertThat(registry.get("hystrix.execution").tags(tags).tags("event", "success").functionCounter().count()).isEqualTo(0.0);
assertThat(registry.get("hystrix.execution").tags(tags).tags("event", "timeout").functionCounter().count()).isEqualTo(0.0);
assertThat(registry.get("hystrix.execution").tags(tags).tags("event", "failure").functionCounter().count()).isEqualTo(0.0);
assertThat(registry.get("hystrix.fallback").tags(tags).tags("event", "fallback_success").functionCounter().count()).isEqualTo(6.0);
assertThat(registry.get("hystrix.circuit.breaker.open").tags(tags).gauge().value()).isEqualTo(1.0);
}
Aggregations