Search in sources :

Example 1 with IDataProducer

use of com.oracle.tck.lib.autd2.unittests.tgfported.algebra.generated.IDataProducer in project jtharness by openjdk.

the class Simple method suite.

public static Test suite() {
    Multiplier multiplier = map -> {
        ICombination action = (ICombination) map.get("action");
        ISimpleOperation o1 = (ISimpleOperation) map.get("op#1");
        ISimpleOperation o2 = (ISimpleOperation) map.get("op#2");
        Object[] objs1 = ((IDataProducer) map.get("v#1")).produce();
        Object[] objs2 = ((IDataProducer) map.get("v#2")).produce();
        Object[] objs3 = ((IDataProducer) map.get("v#3")).produce();
        Values d1 = new ValuesImplSlow(objs1);
        Values d2 = new ValuesImplSlow(objs2);
        Values d3 = new ValuesImplSlow(objs3);
        Values dv = action.operate(o1, o2, d1, d2, d3);
        Values v1 = DataFactory.createColumn(objs1);
        Values v2 = DataFactory.createColumn(objs2);
        Values v3 = DataFactory.createColumn(objs3);
        Values v = action.operate(o1, o2, v1, v2, v3);
        ValuesComparison.compare(v, dv);
    };
    Engine engine = new Engine(multiplier);
    engine.addAspects("v#1", (Object[]) PRODUCERS);
    engine.addAspects("v#2", (Object[]) PRODUCERS);
    engine.addAspects("v#3", (Object[]) PRODUCERS);
    engine.addAspects("op#1", (Object[]) ISimpleOperation.OPERATIONS);
    engine.addAspects("op#2", (Object[]) ISimpleOperation.OPERATIONS);
    engine.addAspects("action", (Object[]) I_COMBINATIONS);
    return engine.createFullyMultipliedSuite();
}
Also used : ValuesImplSlow(com.oracle.tck.lib.autd2.unittests.tgfported.ValuesImplSlow) IDataProducer(com.oracle.tck.lib.autd2.unittests.tgfported.algebra.generated.IDataProducer) DataFactory(com.sun.tck.lib.tgf.DataFactory) Test(junit.framework.Test) AllTests(org.junit.runners.AllTests) Map(java.util.Map) RunWith(org.junit.runner.RunWith) Values(com.sun.tck.lib.tgf.Values) ValuesComparison(com.oracle.tck.lib.autd2.unittests.ValuesComparison) Values(com.sun.tck.lib.tgf.Values) ValuesImplSlow(com.oracle.tck.lib.autd2.unittests.tgfported.ValuesImplSlow)

Aggregations

ValuesComparison (com.oracle.tck.lib.autd2.unittests.ValuesComparison)1 ValuesImplSlow (com.oracle.tck.lib.autd2.unittests.tgfported.ValuesImplSlow)1 IDataProducer (com.oracle.tck.lib.autd2.unittests.tgfported.algebra.generated.IDataProducer)1 DataFactory (com.sun.tck.lib.tgf.DataFactory)1 Values (com.sun.tck.lib.tgf.Values)1 Map (java.util.Map)1 Test (junit.framework.Test)1 RunWith (org.junit.runner.RunWith)1 AllTests (org.junit.runners.AllTests)1