use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.
the class ResourceAggregatorTest method testBundleWithPriority.
/**
* bundle {a, b -> a}, render [x, priority(a)], should render [priority(ab), x]
*/
@Test
public void testBundleWithPriority() {
HeaderItem bundleAB = Application.get().getResourceBundles().addJavaScriptBundle(Application.class, "ab.js", new ResourceReferenceA(), new ResourceReferenceB());
aggregator.render(forReference(new ResourceReferenceX()));
aggregator.render(new PriorityHeaderItem(forReference(new ResourceReferenceA())));
assertItems(new PriorityHeaderItem(bundleAB), forReference(new ResourceReferenceX()));
}
use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.
the class ResourceAggregatorTest method testBundleRenderedAsDependency.
/**
* bundle {a, b->a}, render [d->c->a], should render [ab, c, d]
*/
@Test
public void testBundleRenderedAsDependency() {
HeaderItem bundleAB = Application.get().getResourceBundles().addJavaScriptBundle(Application.class, "ab.js", new ResourceReferenceA(), new ResourceReferenceB());
aggregator.render(forReference(new ResourceReferenceD()));
assertItems(bundleAB, forReference(new ResourceReferenceC()), forReference(new ResourceReferenceD()));
}
use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.
the class ResourceAggregatorTest method testBundle.
/**
* bundle {a, b->a}, render [a], should render [ab]
*/
@Test
public void testBundle() {
HeaderItem bundleAB = Application.get().getResourceBundles().addJavaScriptBundle(Application.class, "ab.js", new ResourceReferenceA(), new ResourceReferenceB());
aggregator.render(forReference(new ResourceReferenceA()));
assertItems(bundleAB);
}
use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.
the class ResourceAggregatorTest method testBundleRenderingOther.
/**
* bundle {a, b->a}, render [b], should render [ab]
*/
@Test
public void testBundleRenderingOther() {
HeaderItem bundleAB = Application.get().getResourceBundles().addJavaScriptBundle(Application.class, "ab.js", new ResourceReferenceA(), new ResourceReferenceB());
aggregator.render(forReference(new ResourceReferenceB()));
assertItems(bundleAB);
}
use of org.apache.wicket.markup.head.HeaderItem in project wicket by apache.
the class ResourceAggregatorTest method testBundleRenderingBoth.
/**
* bundle {a, b->a}, render [a, b], should render [ab]
*/
@Test
public void testBundleRenderingBoth() {
HeaderItem bundleAB = Application.get().getResourceBundles().addJavaScriptBundle(Application.class, "ab.js", new ResourceReferenceA(), new ResourceReferenceB());
aggregator.render(forReference(new ResourceReferenceA()));
aggregator.render(forReference(new ResourceReferenceB()));
assertItems(bundleAB);
}
Aggregations