2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.yang2sources.plugin.it;
10 import org.apache.maven.it.VerificationException;
11 import org.apache.maven.it.Verifier;
12 import org.junit.Test;
14 public class YangToResourcesPluginTest {
17 public void testCorrect() throws VerificationException {
18 Verifier v = YangToSourcesPluginTest.setUp("Correct_resources/", false);
22 static void verifyCorrectLog(Verifier v) throws VerificationException {
23 v.verifyErrorFreeLog();
24 v.verifyTextInLog("[INFO] yang-to-resources: Resource provider instantiated from org.opendaylight.controller.yang2sources.spi.ResourceProviderTestImpl");
25 v.verifyTextInLog("[INFO] yang-to-resources: Resource provider org.opendaylight.controller.yang2sources.spi.ResourceProviderTestImpl call successful");
29 public void testNoGenerators() throws VerificationException {
30 Verifier v = YangToSourcesPluginTest.setUp("NoGenerators_resources/",
32 v.verifyErrorFreeLog();
33 v.verifyTextInLog("[WARNING] yang-to-resources: No resource provider classes provided");
37 public void testUnknownGenerator() throws VerificationException {
38 Verifier v = YangToSourcesPluginTest.setUp(
39 "UnknownGenerator_resources/", true);
40 v.verifyTextInLog("[ERROR] yang-to-resources: Unable to provide resources with unknown resource provider");
41 v.verifyTextInLog("java.lang.ClassNotFoundException: unknown");
42 v.verifyTextInLog("[INFO] yang-to-resources: Resource provider instantiated from org.opendaylight.controller.yang2sources.spi.ResourceProviderTestImpl");
43 v.verifyTextInLog("[INFO] yang-to-resources: Resource provider org.opendaylight.controller.yang2sources.spi.ResourceProviderTestImpl call successful");
44 v.verifyTextInLog("[ERROR] yang-to-resources: One or more code resource provider failed, including failed list(resourceProviderClass=exception) {unknown=java.lang.ClassNotFoundException}");