--- /dev/null
+#include "module/plugin/PluginProxy.h"
+
+#include "gtest/gtest.h"
+
+#define STRING(s) _STRING(s)
+#define _STRING(s) #s
+
+using namespace nncc::contrib::module::plugin;
+
+void tryCreatePluginProxy(std::string path)
+{
+ try
+ {
+ std::shared_ptr<PluginProxy> pp = PluginProxy::create(path);
+ FAIL();
+ }
+ catch (nncc::foundation::Exception &e){}
+}
+
+TEST(CONTRIB_NNC, PluginProxy)
+{
+ // Create PluginProxy from path with '/' and without, to visit both execution pathes
+ tryCreatePluginProxy("/some/path/pluginName");
+ tryCreatePluginProxy("pluginName");
+
+ // Create PluginProxy with sample plugin
+ std::shared_ptr<PluginProxy> pp = PluginProxy::create(STRING(CMAKE_SAMPLE_PLUGIN_ABS_PATH));
+ ASSERT_EQ(pp->getPluginPath(), STRING(CMAKE_SAMPLE_PLUGIN_ABS_PATH));
+ ASSERT_EQ(pp->getPluginName(), "libsome_parser.so");
+ ASSERT_NE(&pp->getPluginInstance(), nullptr);
+
+ // Operator '<<'
+ std::ostringstream os;
+ os << *pp;
+ ASSERT_EQ(os.str(), STRING(CMAKE_SAMPLE_PLUGIN_ABS_PATH));
+}